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

Required attribute for checkboxes works in unexpected way by default #18

Open
matty22 opened this issue Dec 27, 2017 · 0 comments
Open

Comments

@matty22
Copy link
Owner

matty22 commented Dec 27, 2017

What is the current behavior?


Using the required attribute on a set of checkboxes with the same name, does not work the same way as using the required attribute on a set of radio buttons with the same name. For radio buttons, you can mark any one or all related radio buttons as required and the form will by default validate if any one of those radio buttons is checked. For checkboxes, you have to mark every checkbox field as required and it actually sets every individual checkbox as required (not a single checkbox in a grouped set of checkboxes with the same name).

What is the expected behavior?


Checkboxes should validate the same way that radio buttons do. If the user checks any one or more checkboxes in a related set of checkboxes, the form should validate.

If this issue is a question or feature request, what is the motivation / use case for changing the current behavior?


The use case here is to get checkbox questions to validate properly. So people filling out a survey aren't required to check every single checkbox in a given set.

Other information (detailed explanation, stacktraces, related issues, suggestions on how to fix, links for context, eg. StackOverflow, Gitter, etc)


This issue stems from the default nature of checkbox input elements and how the required attribute works on them. This issue will require some validation JavaScript to be exported in any form that contains a checkbox question that is marked as required.

@matty22 matty22 added this to the Version 1.0 milestone Jan 27, 2018
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

1 participant