Skip to content
Browse files

Replace deprecated :checkbox and :radio with [type=checkbox] and [typ…

…e=radio] selectors.
  • Loading branch information...
1 parent a59f28f commit 3014cd54a178c23fb2ecfe9c55ef258707988cb4 @javierjulio javierjulio committed Nov 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/rails.js
View
4 src/rails.js
@@ -257,12 +257,12 @@
allInputs.each(function() {
input = $(this);
- valueToCheck = input.is(':checkbox,:radio') ? input.is(':checked') : input.val();
+ valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : input.val();
// If nonBlank and valueToCheck are both truthy, or nonBlank and valueToCheck are both falsey
if (!valueToCheck === !nonBlank) {
// Don't count unchecked required radio if other radio with same name is checked
- if (input.is(':radio') && allInputs.filter('input:radio:checked[name="' + input.attr('name') + '"]').length) {
+ if (input.is('input[type=radio]') && allInputs.filter('input[type=radio]:checked[name="' + input.attr('name') + '"]').length) {
return true; // Skip to next input
}

0 comments on commit 3014cd5

Please sign in to comment.
Something went wrong with that request. Please try again.