We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If you want to deserialize a model into multiple checkboxes it doesn't behave correctly.
For instance if you have a model like:
{languages: ['en']}
and a form:
<input name="languages[]" type="checkbox" value="en"> <input name="languages[]" type="checkbox" value="fr">
Then syphon will check both checkboxes.
Our current solution is to only check the checkboxes that actually match on the value like:
Backbone.Syphon.InputWriters.register("checkbox", function ($el, value) { if (_.isArray(value)) { if (_.contains(value, $el.val())) { $el.prop("checked", true) } } else { $el.prop("checked", value) } })
The text was updated successfully, but these errors were encountered:
@diasjorge Sorry this wasn't addressed sooner. It has now been marked critical.
Sorry, something went wrong.
Hi @diasjorge I'm going to close this one as a duplicate of #25
Thanks for your hint around the InputWriter
InputWriter
Ping @rogelio2k
No branches or pull requests
If you want to deserialize a model into multiple checkboxes it doesn't behave correctly.
For instance if you have a model like:
and a form:
Then syphon will check both checkboxes.
Our current solution is to only check the checkboxes that actually match on the value like:
The text was updated successfully, but these errors were encountered: