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

Fix checkboxes sent value #310

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

watery
Copy link
Contributor

@watery watery commented Mar 20, 2018

Checkboxes always send a value even when unchecked, this should fix it.

@jrivard
Copy link
Contributor

jrivard commented Mar 22, 2018

The true/false values are working as intended, for LDAP boolean syntax it's important to actually set a value for valse...

That being said I understand how their could be situations where you want different behavior, but I think they would have to be configurable somehow...

@watery
Copy link
Contributor Author

watery commented Mar 22, 2018

The true/false values are working as intended, for LDAP boolean syntax it's important to actually set a value for valse...

I'm not sure to understand here: if I'm not mistaken, HTML checkboxes can only have a single value attribute which is either sent or not sent at all on form submit.

I won't be able to go back to the original code pretty soon, but I recall detecting checkbox values being sent to the server even for unchecked ones, and portions in FormUtility class, most probably the checkboxValueIsChecked() method, to parse those values as true.

That being said I understand how their could be situations where you want different behavior, but I think they would have to be configurable somehow...

Well, I'm using checkboxes to collect privacy policy agreements, where one agreement is mandatory while the other is optional: true or false values are enough and if I correctly understand the code, they should work out-of-the-box.

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 this pull request may close these issues.

None yet

2 participants