Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form builder widgets of the type "checkboxes", when required, are rejected unless all checkboxes are selected #1556

Open
ahayzen opened this issue Jul 28, 2015 · 3 comments

Comments

@ahayzen
Copy link

ahayzen commented Jul 28, 2015

What happened:

  1. A form builder was created that has the option to add a widget of the type "checkboxes"
  2. A form was created with a widget of type "checkboxes", this had at least two choices and was set to be required
  3. A user opened the form, one of the checkboxes was checked and the form was submitted
  4. The form was rejected as all of the checkboxes were not selected

What was expected to happen:

  • At step 4 for the required option on the widget to only require, at minimum, one checkbox to be checked not all of them.
@lb-
Copy link
Member

lb- commented Nov 28, 2017

Google Forms, Zoho Forms and Wufoo forms all treat at least one checkbox ticked as valid when there are a group of checkboxes required.

Radios provide the ability to indicate only one is required.

There does not appear to be a standard on groups of checkboxes, only checkboxes being required individually.
See: https://www.w3.org/html/wg/tracker/issues/111
See: https://dev.w3.org/html5/spec-preview/the-fieldset-element.html (no reference to fieldsets having required attribute)

@BertrandBordage BertrandBordage self-assigned this Apr 16, 2018
@BertrandBordage
Copy link
Member

As part of the Wagtail’s first Kickstarter campaign, I’m working on this!
https://www.kickstarter.com/projects/noripyt/wagtails-first-hatch

@thibaudcolas
Copy link
Member

There is no such thing in HTML as a "group of checkboxes", so at least to me the behavior described above seems reasonable in this case.

  • If you want "at least one option selected", then a "Multiple select" will do this.
  • If you want "only one", then a radio button will do this

Although we could implement what’s suggested here on the validation side, for users of such a form, there would be no way for them to tell they have to check "one of this group". For screen reader users in particular, there is no way to semantically mark a checkbox as part of a group aside from fieldset, which is only there for labelling, not validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants