checkbox()
Ensure proper number of checkboxes selected.
Setup
Attribute: sf-validation="checkbox(MIN_NUM, MAX_NUM)"
Where: Checkbox Group
Ensures that a specific range of checkboxes are selected within a group. This is useful for forms where users must make a certain number of selections, such as surveys or multi-select options.
HTML Example
Webflow Example
Usage Examples
checkbox(0,10)
: Requires at least 0 checkboxes to be selected, and allows up to 10 checkboxes to be selected.checkbox(2)
: Requires at least 2 checkboxes to be selected, with no restriction on the maximum number of selections.checkbox(3,3)
: Requires exactly 3 checkboxes to be selected.
Attribute Configuration
Make sure to add the sf-validation="checkbox(MIN_NUM,MAX_NUM)"
attribute to valid checkbox groups as mentioned above. Here are some instructions to keep in mind:
The attribute value should follow the format
checkbox(MIN_NUM,MAX_NUM)
orcheckbox(MIN_NUM)
.
Last updated
Was this helpful?