mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-24 12:13:59 +01:00
Fixed issue 78. Error/Valid styling applies to all radio buttons of same group for required validation.
This commit is contained in:
17
test/test.js
17
test/test.js
@@ -124,6 +124,23 @@ test("form(): checkboxes: min/required", function() {
|
||||
$('#form6check2').attr("checked", true);
|
||||
ok( v.form(), 'Valid form' );
|
||||
});
|
||||
|
||||
test("form(): radio buttons: required", function () {
|
||||
expect( 6 );
|
||||
var form = $('#testForm10')[0];
|
||||
|
||||
var v = $(form).validate({ rules: { testForm10Radio: "required"} });
|
||||
ok(!v.form(), 'Invalid Form');
|
||||
equals($('#testForm10Radio1').attr('class'), 'error');
|
||||
equals($('#testForm10Radio2').attr('class'), 'error');
|
||||
|
||||
$('#testForm10Radio2').attr("checked", true);
|
||||
ok(v.form(), 'Valid form');
|
||||
|
||||
equals($('#testForm10Radio1').attr('class'), 'valid');
|
||||
equals($('#testForm10Radio2').attr('class'), 'valid');
|
||||
});
|
||||
|
||||
test("form(): selects: min/required", function() {
|
||||
expect( 3 );
|
||||
var form = $('#testForm7')[0];
|
||||
|
||||
Reference in New Issue
Block a user