Class CheckboxValidationBuilder

CheckboxValidationBuilder

DataאימותBuilder של CheckboxValidation.

// 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)

חייב להיבחר לפחות מספר האפשרויות הזה.

פרמטרים

שםתיאורהתיאור
numberInteger

החזרות

CheckboxValidationBuilderCheckboxValidationBuilder, לשרשור


requireSelectAtMost(number)

מספר האפשרויות מוגבל שאפשר לבחור.

פרמטרים

שםתיאורהתיאור
numberInteger

החזרות

CheckboxValidationBuilderCheckboxValidationBuilder, לשרשור


requireSelectExactly(number)

עליכם לבחור בדיוק את מספר האפשרויות הזה.

פרמטרים

שםתיאורהתיאור
numberInteger

החזרות

CheckboxValidationBuilderCheckboxValidationBuilder, לשרשור