Checkbox & Radio Fields

Checkboxes and radio fields need to be written in a specific way when used with KwesForms in order to benefit from our validation rules. Read below to find out how to correctly use them.

Checkbox Groups

  • Wrap your group of checkboxes inside a <fieldset data-kw-group>. All inputs inside the group must have the same name.
  • Add any validation rules inside a rules attribute in the <fieldset data-kw-group>.
  • You don't have to add validation rules if you don't need it.


Single Checkbox

Single checkboxes are normally used as booleans. If you don't add any value attribute to single checkboxes it will be treated as a boolean checkbox automatically.

  • Add rules inside a rules attribute inside the single checkbox input.
  • You don't have to add validation rules if you don't need it.

Radio Group

  • Wrap your group of radio fields inside a <fieldset data-kw-group>. All inputs inside the group must have the same name.
  • Add any validation rules inside a rules attribute in the <fieldset data-kw-group>.
  • You don't have to add validation rules if you don't need it.



Notice anything wrong in our docs? Let us know.