File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 16
16
alert ( "submitted!" ) ;
17
17
}
18
18
} ) ;
19
- $ . validator . messages . max = jQuery . format ( "Your totals mustn't exceed {0}!" ) ;
19
+ $ . validator . messages . max = jQuery . validator . format ( "Your totals mustn't exceed {0}!" ) ;
20
20
21
21
$ . validator . addMethod ( "quantity" , function ( value , element ) {
22
22
return ! this . optional ( element ) && ! this . optional ( $ ( element ) . parent ( ) . prev ( ) . children ( "select" ) [ 0 ] ) ;
31
31
$ ( element ) . addClass ( errorClass ) . parent ( ) . prev ( ) . children ( "select" ) . addClass ( errorClass ) ;
32
32
}
33
33
} ) ;
34
-
35
- var template = jQuery . format ( $ ( "#template" ) . val ( ) ) ;
34
+
35
+ var template = jQuery . validator . format ( $ . trim ( $ ( "#template" ) . val ( ) ) ) ;
36
36
function addRow ( ) {
37
37
$ ( template ( i ++ ) ) . appendTo ( "#orderitems tbody" ) ;
38
38
}
39
-
39
+
40
40
var i = 1 ;
41
41
// start with one row
42
42
addRow ( ) ;
43
43
// add more rows on click
44
44
$ ( "#add" ) . click ( addRow ) ;
45
-
45
+
46
46
// check keyup on quantity inputs to update totals field
47
47
$ ( "#orderform" ) . validateDelegate ( "input.quantity" , "keyup" , function ( event ) {
48
48
var totals = 0 ;
51
51
} ) ;
52
52
$ ( "#totals" ) . attr ( "value" , totals ) . valid ( ) ;
53
53
} ) ;
54
-
54
+
55
55
} ) ;
56
56
</ script >
57
57
@@ -110,12 +110,12 @@ <h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-vali
110
110
111
111
< form id ="orderform " class ="cmxform " method ="get " action ="foo.html ">
112
112
< h2 id ="summary "> </ h2 >
113
-
113
+
114
114
< fieldset >
115
115
< legend > Example with custom methods and heavily customized error display</ legend >
116
116
< table id ="orderitems ">
117
117
< tbody >
118
-
118
+
119
119
</ tbody >
120
120
< tfoot >
121
121
< tr >
You can’t perform that action at this time.
0 commit comments