How to make all the options under "checkboxes" field mandatory | Community
Skip to main content
Level 4
January 20, 2016
Question

How to make all the options under "checkboxes" field mandatory

  • January 20, 2016
  • 1 reply
  • 3311 views

I need to to have multiple checkboxes in a form and all checkboxes should be mandatory so I used a field with field type 'checkboxes"  and made it mandatory however the the issue is even if I click check one checkbox it allows the form to be submitted.

Any suggestions?

Note: I dont want to use a different fields for each check box.

1 reply

SanfordWhiteman
Level 10
January 20, 2016

I don't understand the user experience you're going for.  The definition of "mandatory" is that the underlying field must end up with a non-empty value.  If every one of your checkboxes is mandatory, that means the mandatory value of the field is, for example "1;2;3;4".  Why would you give people a one-or-more widget (that's what the checkbox set means) when you actually mean "all"?

Josh_Hill13
Level 10
January 20, 2016

In other words, the checkbox/boolean must always be set to TRUE in your Form, but in reality, no choice needs to be made since a checkbox can be T/F.

Try a radio button or reconsider how you ask the questions.

SanfordWhiteman
Level 10
January 20, 2016

Yeah, it seems like the more appropriate widget is a checkbox, as opposed to checkboxes.  Really, even if you make all the checkboxes mandatory (which is easy using a little JS) it's still kind of strange to the user... you're making them spend extra clicks for no payoff.