Skip to content

Boolean attributes now sync properly for radio buttons and checkboxes. #148

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

escoberik
Copy link

Checkable inputs need the property "checked" to be settled to
true/false instead of the "value" attribute.

Checkable inputs need the property "checked" to be settled to
true/false instead of the "value" attribute.
@gabetax
Copy link

gabetax commented Mar 22, 2013

Array#indexOf is not supported in IE8 and earlier. Given that backbone relies on underscore.js, you could instead rely on _.contains() (note the nativeIndexOf check):

  $.fn.isCheckable = function() {
    return _.contains(["checkbox", "radio"], this.attr("type"));
  };

Otherwise, 👍

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.

2 participants