CheckboxValidation
के लिए DataValidationBuilder.
// Add a checkBox item to a form and require exactly two selections. var checkBoxItem = form.addCheckboxItem(); checkBoxItem.setTitle('What two condiments would you like on your hot dog?'); checkBoxItem.setChoices([ checkBoxItem.createChoice('Ketchup'), checkBoxItem.createChoice('Mustard'), checkBoxItem.createChoice('Relish') ]); var checkBoxValidation = FormApp.createCheckboxValidation() .setHelpText(“Select two condiments.”) .requireSelectExactly(2) .build(); checkBoxItem.setValidation(checkBoxValidation);
तरीके
तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
---|---|---|
requireSelectAtLeast(number) | CheckboxValidationBuilder | कम से कम इतने विकल्प चुनने की ज़रूरत है. |
requireSelectAtMost(number) | CheckboxValidationBuilder | इतने विकल्प चुने जा सकते हैं. |
requireSelectExactly(number) | CheckboxValidationBuilder | इतने विकल्प चुनने की ज़रूरत है. |
ज़्यादा जानकारी के साथ दस्तावेज़
requireSelectAtLeast(number)
कम से कम इतने विकल्प चुनने की ज़रूरत है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
number | Integer |
रिटर्न
CheckboxValidationBuilder
— यह CheckboxValidationBuilder
, चेन बनाने के लिए है
requireSelectAtMost(number)
इतने विकल्प चुने जा सकते हैं.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
number | Integer |
रिटर्न
CheckboxValidationBuilder
— यह CheckboxValidationBuilder
, चेन बनाने के लिए है
requireSelectExactly(number)
इतने विकल्प चुनने की ज़रूरत है.
पैरामीटर
नाम | Type | ब्यौरा |
---|---|---|
number | Integer |
रिटर्न
CheckboxValidationBuilder
— यह CheckboxValidationBuilder
, चेन बनाने के लिए है