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 1616 alert ( "submitted!" ) ;
1717 }
1818} ) ;
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}!" ) ;
2020
2121$ . validator . addMethod ( "quantity" , function ( value , element ) {
2222 return ! this . optional ( element ) && ! this . optional ( $ ( element ) . parent ( ) . prev ( ) . children ( "select" ) [ 0 ] ) ;
3131 $ ( element ) . addClass ( errorClass ) . parent ( ) . prev ( ) . children ( "select" ) . addClass ( errorClass ) ;
3232 }
3333 } ) ;
34-
35- var template = jQuery . format ( $ ( "#template" ) . val ( ) ) ;
34+
35+ var template = jQuery . validator . format ( $ . trim ( $ ( "#template" ) . val ( ) ) ) ;
3636 function addRow ( ) {
3737 $ ( template ( i ++ ) ) . appendTo ( "#orderitems tbody" ) ;
3838 }
39-
39+
4040 var i = 1 ;
4141 // start with one row
4242 addRow ( ) ;
4343 // add more rows on click
4444 $ ( "#add" ) . click ( addRow ) ;
45-
45+
4646 // check keyup on quantity inputs to update totals field
4747 $ ( "#orderform" ) . validateDelegate ( "input.quantity" , "keyup" , function ( event ) {
4848 var totals = 0 ;
5151 } ) ;
5252 $ ( "#totals" ) . attr ( "value" , totals ) . valid ( ) ;
5353 } ) ;
54-
54+
5555} ) ;
5656</ script >
5757
@@ -110,12 +110,12 @@ <h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-vali
110110
111111< form id ="orderform " class ="cmxform " method ="get " action ="foo.html ">
112112 < h2 id ="summary "> </ h2 >
113-
113+
114114 < fieldset >
115115 < legend > Example with custom methods and heavily customized error display</ legend >
116116 < table id ="orderitems ">
117117 < tbody >
118-
118+
119119 </ tbody >
120120 < tfoot >
121121 < tr >
You can’t perform that action at this time.
0 commit comments