Class ParagraphTextValidationBuilder
段落文字驗證結構
ParagraphTextValidation
的 DataValidationBuilder。
// Add a paragraph text item to a form and require the answer to be at least 100
// characters.
const form = FormApp.create('My Form');
const paragraphTextItem =
form.addParagraphTextItem().setTitle('Describe yourself:');
const paragraphtextValidation =
FormApp.createParagraphTextValidation()
.setHelpText('Answer must be more than 100 characters.')
.requireTextLengthGreaterThan(100);
paragraphTextItem.setValidation(paragraphtextValidation);
內容詳盡的說明文件
requireTextContainsPattern(pattern)
requireTextDoesNotContainPattern(pattern)
requireTextDoesNotMatchPattern(pattern)
requireTextLengthGreaterThanOrEqualTo(number)
requireTextLengthLessThanOrEqualTo(number)
requireTextMatchesPattern(pattern)
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-22 (世界標準時間)。
[null,null,["上次更新時間:2024-12-22 (世界標準時間)。"],[[["`ParagraphTextValidationBuilder` lets you set validation rules for paragraph text responses in Google Forms."],["You can enforce rules like minimum/maximum text length, and require or exclude specific patterns in the text."],["All validation methods return the `ParagraphTextValidationBuilder` object itself, enabling method chaining for concise code."],["Use this class with `FormApp.createParagraphTextValidation()` to define the validation for a paragraph text item."],["Refer to the detailed documentation and method table for specifics on each validation rule and its parameters."]]],[]]