Permalink
Browse files

Merge pull request #466 from romanbsd/3-2-stable

jQuery 1.9 compatibility, use .prop('checked')
  • Loading branch information...
2 parents 29a6e49 + 7cea9f2 commit bf8f9824d8bcdd71b49273c5bf7465750ceb07c2 @bcardarella bcardarella committed Jan 23, 2013
@@ -207,7 +207,7 @@ window.ClientSideValidations.validators =
acceptance: (element, options) ->
switch element.attr('type')
when 'checkbox'
- unless element.attr('checked')
+ unless element.prop('checked')
return options.message
when 'text'
if element.val() != (options.accept?.toString() || '1')
@@ -100,7 +100,7 @@ test('Validate when checkbox is clicked', function() {
var form = $('form#new_user'), input = form.find('input#user_agree');
var label = $('label[for="user_agree"]');
- input.attr('checked', false)
+ input.prop('checked', false)
input.trigger('click');
ok(input.parent().hasClass('field_with_errors'));
ok(label.parent().hasClass('field_with_errors'));
@@ -3,7 +3,7 @@ module('Acceptance options');
test('when checkbox and checked', function() {
var element = $('<input type="checkbox" />');
var options = { message: "failed validation" };
- element.attr('checked', true)
+ element.prop('checked', true)
equal(ClientSideValidations.validators.local.acceptance(element, options), undefined);
});

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit bf8f982

Please sign in to comment.