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 checkboxes are not validated correctly on the server side #143

Closed
jrauh01 opened this issue Mar 24, 2025 · 1 comment · Fixed by #144
Closed

Required checkboxes are not validated correctly on the server side #143

jrauh01 opened this issue Mar 24, 2025 · 1 comment · Fixed by #144
Assignees
Milestone

Comments

@jrauh01
Copy link
Contributor

jrauh01 commented Mar 24, 2025

By default, in html you can't submit unchecked checkboxes if they are set to 'required'. In our forms, if you remove the 'required' tag in the browser's dev tools, you can submit a checkbox even if it's not checked. I think this shouldn't be possible to prevent submitting a form where the user's agreement is mandatory (terms and conditions for example).

@nilmerg
Copy link
Member

nilmerg commented Mar 24, 2025

Didn't verify this myself, but it seems that since a checkbox element always has a value, hasValue() always returns true. It is potentially enough to override it and return false in case the unchecked value is set.

@jrauh01 jrauh01 added the bug Something isn't working label Mar 24, 2025
@nilmerg nilmerg added this to the v0.9.0 milestone Mar 24, 2025
@nilmerg nilmerg removed the bug Something isn't working label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants