Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Class CheckboxValidation
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
CheckboxValidation
Eine DataValidation für ein CheckboxItem.
// Add a checkBox item to a form and require exactly two selections.
const form = FormApp.create('My Form');
const 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'),
]);
const checkBoxValidation = FormApp.createCheckboxValidation()
.setHelpText('Select two condiments.')
.requireSelectExactly(2)
.build();
checkBoxItem.setValidation(checkBoxValidation);
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2026-04-13 (UTC).
[null,null,["Zuletzt aktualisiert: 2026-04-13 (UTC)."],[],[]]