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

An indeterminate checkbox will be a null value #95

Merged

Conversation

rhubarbselleven
Copy link
Contributor

This is #76 with tests.

It provides the checkbox indeterminate attribute as a null when serializing and deserializing.

@rhubarbselleven
Copy link
Contributor Author

When a form is submitted, an indeterminate checkbox value is submitted also. Syphon should follow this behavior.

If you're looking to use checkbox indeterminate, create your own InputReader. See https://github.com/marionettejs/backbone.syphon/pull/95/files#diff-d762c10e9f5f64e96a72e53782bd6a6dR20

Note http://jsfiddle.net/x42y4agj/ for the proof

@happylinks
Copy link

Mm ok, so if I understand correctly. A indeterminate checkbox is always submitted as true?
Strange behaviour, but sure, I'll implement it myself using an InputReader.
Thanks for the help.

@rhubarbselleven
Copy link
Contributor Author

Ah wait... derp

When a form is submitted the with an indeterminate, the indeterminate's value is submitted also.

However; Syphon disregards a checkboxes value and is only interested in the checked state to derive a boolean value.

We're back in 💥 💃

@rhubarbselleven
Copy link
Contributor Author

ping @samccone

rhubarbselleven added a commit that referenced this pull request Mar 18, 2015
An indeterminate checkbox will be a null value
@rhubarbselleven rhubarbselleven merged commit 0559800 into marionettejs:minor Mar 18, 2015
@rhubarbselleven
Copy link
Contributor Author

💥 into the next release

@happylinks
Copy link

Yeahh nice!

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