choice
Validates that the number of selected checkboxes in a group is within a specified range.
Options
| Option | Type | Default | Description |
|---|---|---|---|
min | number | undefined | Minimum number of checkboxes that must be checked |
max | number | undefined | Maximum number of checkboxes that can be checked |
message | string | locale default | Custom error message |
Playground
Valid values
| Value | Notes |
|---|---|
| 2 checkboxes checked | Within min=1, max=3 |
| 1 checkbox checked | Equal to min |
Invalid values
| Value | Reason |
|---|---|
| 0 checkboxes checked | Below min=1 |
| 4 checkboxes checked | Exceeds max=3 |
Notes
- If no checkboxes are checked,
choicecounts 0 selected items. Setmin: 1or higher to require at least one selection. - Do not combine with
notEmpty— it checks string values, not checkbox state. - Applies to groups of checkboxes sharing the same
nameattribute.