// 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);
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-01-12 UTC."],[[["`CheckboxValidation` is used to set validation rules specifically for checkbox items within Google Forms."],["It allows you to define requirements like the number of choices a user must select using methods like `requireSelectExactly()`."],["A help text can be associated with the validation to guide the user using `setHelpText()`."]]],[]]