@@ -203,7 +203,7 @@ test("hide(): errorWrapper", function() {
203
203
var errorLabel = $ ( '#errorWrapper' ) ;
204
204
var element = $ ( '#meal' ) [ 0 ] ;
205
205
element . selectedIndex = 1 ;
206
-
206
+
207
207
errorLabel . show ( ) ;
208
208
ok ( errorLabel . is ( ":visible" ) , "Error label visible after validation" ) ;
209
209
var v = $ ( '#testForm3' ) . validate ( { wrapper : "li" , errorLabelContainer : $ ( "#errorContainer" ) } ) ;
@@ -278,23 +278,23 @@ test("showErrors(), allow empty string and null as default message", function()
278
278
rules : {
279
279
username : {
280
280
required : true ,
281
- minlength : 3
281
+ minlength : 3
282
282
}
283
283
} ,
284
284
messages : {
285
285
username : {
286
286
required : "" ,
287
287
minlength : "too short"
288
- }
288
+ }
289
289
}
290
290
} ) ;
291
291
ok ( ! $ ( "#username" ) . valid ( ) ) ;
292
292
equals ( "" , $ ( "label.error[for=username]" ) . text ( ) ) ;
293
-
293
+
294
294
$ ( "#username" ) . val ( "ab" ) ;
295
295
ok ( ! $ ( "#username" ) . valid ( ) ) ;
296
296
equals ( "too short" , $ ( "label.error[for=username]" ) . text ( ) ) ;
297
-
297
+
298
298
$ ( "#username" ) . val ( "abc" ) ;
299
299
ok ( $ ( "#username" ) . valid ( ) ) ;
300
300
ok ( $ ( "label.error[for=username]" ) . is ( ":hidden" ) ) ;
@@ -318,7 +318,7 @@ test("showErrors() - external messages", function() {
318
318
v . form ( ) ;
319
319
equals ( $ ( "#testForm4 label.error[for=f1]" ) . text ( ) , "Please!" ) ;
320
320
equals ( $ ( "#testForm4 label.error[for=f2]" ) . text ( ) , "Wohoo!" ) ;
321
-
321
+
322
322
$ . validator . methods = methods ;
323
323
$ . validator . messages = messages ;
324
324
} ) ;
@@ -472,10 +472,10 @@ test("formatAndAdd", function() {
472
472
v . formatAndAdd ( fakeElement , { method : "maxlength" , parameters : 2 } )
473
473
equals ( "Please enter no more than 2 characters." , v . errorList [ 0 ] . message ) ;
474
474
equals ( "bar" , v . errorList [ 0 ] . element . name ) ;
475
-
475
+
476
476
v . formatAndAdd ( fakeElement , { method : "range" , parameters :[ 2 , 4 ] } )
477
477
equals ( "Please enter a value between 2 and 4." , v . errorList [ 1 ] . message ) ;
478
-
478
+
479
479
v . formatAndAdd ( fakeElement , { method : "range" , parameters :[ 0 , 4 ] } )
480
480
equals ( "Please enter a value between 0 and 4." , v . errorList [ 2 ] . message ) ;
481
481
} ) ;
@@ -522,12 +522,12 @@ test("error containers, simple", function() {
522
522
this . defaultShowErrors ( ) ;
523
523
}
524
524
} ) ;
525
-
525
+
526
526
v . prepareForm ( ) ;
527
527
ok ( v . valid ( ) , "form is valid" ) ;
528
528
equals ( 0 , container . find ( "label" ) . length , "There should be no error labels" ) ;
529
529
equals ( "" , container . find ( "h3" ) . html ( ) ) ;
530
-
530
+
531
531
v . prepareForm ( ) ;
532
532
v . errorList = [ { message :"bar" , element : { name :"foo" } } , { message : "necessary" , element : { name :"required" } } ] ;
533
533
ok ( ! v . valid ( ) , "form is not valid after adding errors manually" ) ;
@@ -538,7 +538,7 @@ test("error containers, simple", function() {
538
538
ok ( $ ( this ) . is ( ":visible" ) , "Check that each label is visible" ) ;
539
539
} ) ;
540
540
equals ( "There are 2 errors in your form." , container . find ( "h3" ) . html ( ) ) ;
541
-
541
+
542
542
v . prepareForm ( ) ;
543
543
ok ( v . valid ( ) , "form is valid after a reset" ) ;
544
544
v . showErrors ( ) ;
@@ -558,12 +558,12 @@ test("error containers, with labelcontainer I", function() {
558
558
errorLabelContainer : labelcontainer ,
559
559
wrapper : "li"
560
560
} ) ;
561
-
561
+
562
562
ok ( v . valid ( ) , "form is valid" ) ;
563
563
equals ( 0 , container . find ( "label" ) . length , "There should be no error labels in the container" ) ;
564
564
equals ( 0 , labelcontainer . find ( "label" ) . length , "There should be no error labels in the labelcontainer" ) ;
565
565
equals ( 0 , labelcontainer . find ( "li" ) . length , "There should be no lis labels in the labelcontainer" ) ;
566
-
566
+
567
567
v . errorList = [ { message :"bar" , element : { name :"foo" } } , { name : "required" , message : "necessary" , element : { name :"required" } } ] ;
568
568
ok ( ! v . valid ( ) , "form is not valid after adding errors manually" ) ;
569
569
v . showErrors ( ) ;
@@ -603,12 +603,12 @@ test("errorcontainer, show/hide only on submit", function() {
603
603
equals ( "There are 2 errors in your form." , container . html ( ) ) ;
604
604
ok ( labelContainer . is ( ":visible" ) , "must be visible" ) ;
605
605
ok ( container . is ( ":visible" ) , "must be visible" ) ;
606
-
606
+
607
607
$ ( "#firstname" ) . val ( "hix" ) . keyup ( ) ;
608
608
$ ( "#testForm1" ) . triggerHandler ( "keyup" , [ jQuery . event . fix ( { type : "keyup" , target : $ ( "#firstname" ) [ 0 ] } ) ] ) ;
609
609
equals ( 1 , labelContainer . find ( "label:visible" ) . length ) ;
610
610
equals ( "There are 1 errors in your form." , container . html ( ) ) ;
611
-
611
+
612
612
$ ( "#lastname" ) . val ( "abc" ) ;
613
613
ok ( v . form ( ) , "Form now valid, trigger showErrors but not invalid-form" ) ;
614
614
} ) ;
@@ -853,7 +853,7 @@ test("all rules are evaluated even if one returns a dependency-mistmatch", funct
853
853
equals ( 0 , $ ( "#testForm1 label" ) . size ( ) ) ;
854
854
$ ( "#firstname" ) . valid ( ) ;
855
855
equals ( 0 , $ ( "#testForm1 label" ) . size ( ) ) ;
856
-
856
+
857
857
delete $ . validator . methods . custom1 ;
858
858
delete $ . validator . messages . custom1 ;
859
859
} ) ;
@@ -897,7 +897,7 @@ test("option: subformRequired", function() {
897
897
$ ( "#bill_to_co" ) . attr ( "checked" , false ) ;
898
898
v . form ( ) ;
899
899
equals ( 2 , v . size ( ) ) ;
900
-
900
+
901
901
delete $ . validator . methods . billingRequired ;
902
902
delete $ . validator . messages . billingRequired ;
903
903
} ) ;
@@ -1062,7 +1062,7 @@ test("validate checkbox on click", function() {
1062
1062
}
1063
1063
function trigger ( element ) {
1064
1064
element . click ( ) ;
1065
- // triggered click event screws up checked-state in 1.4
1065
+ // triggered click event screws up checked-state in 1.4
1066
1066
element . valid ( ) ;
1067
1067
}
1068
1068
var e = $ ( "#check2" ) ;
@@ -1088,7 +1088,7 @@ test("validate multiple checkbox on click", function() {
1088
1088
}
1089
1089
function trigger ( element ) {
1090
1090
element . click ( ) ;
1091
- // triggered click event screws up checked-state in 1.4
1091
+ // triggered click event screws up checked-state in 1.4
1092
1092
element . valid ( ) ;
1093
1093
}
1094
1094
var e1 = $ ( "#check1" ) . attr ( "checked" , false ) ;
@@ -1116,7 +1116,7 @@ test("validate multiple checkbox on click", function() {
1116
1116
test ( "correct checkbox receives the error" , function ( ) {
1117
1117
function trigger ( element ) {
1118
1118
element . click ( ) ;
1119
- // triggered click event screws up checked-state in 1.4
1119
+ // triggered click event screws up checked-state in 1.4
1120
1120
element . valid ( ) ;
1121
1121
}
1122
1122
var e1 = $ ( "#check1" ) . attr ( "checked" , false ) ;
@@ -1141,7 +1141,7 @@ test("validate radio on click", function() {
1141
1141
}
1142
1142
function trigger ( element ) {
1143
1143
element . click ( ) ;
1144
- // triggered click event screws up checked-state in 1.4
1144
+ // triggered click event screws up checked-state in 1.4
1145
1145
element . valid ( ) ;
1146
1146
}
1147
1147
var e1 = $ ( "#radio1" ) ;
0 commit comments