@@ -256,36 +256,36 @@ JSValidator.Form.prototype = {
256
256
257
257
fields . forEach ( function ( field ) {
258
258
field . bindValidationToEvent ( "submit" ) ;
259
- } ) ,
260
-
261
- JSValidator . Utils . _bindEvent ( instance . formElement , "submit" , function ( event ) {
262
-
263
- // Do preValidation
264
- instance . _doAction ( event , null , "preSubmitValidationProcess" ) ;
265
-
266
- var validate = true ;
267
- instance . getFields ( ) . forEach ( function ( field ) {
268
- field . _doValidateField ( event , field , function ( ruleViolation ) {
269
- var ruleViolationsByField = [ ] ;
270
-
271
- if ( ruleViolation . length > 0 ) {
272
- validate = false ;
273
- ruleViolationsByField . push ( {
274
- field : field . name ,
275
- ruleViolations : ruleViolation
276
- } )
277
- }
278
-
279
- // Do postValidation
280
- instance . _doAction ( event , ruleViolationsByField , "postSubmitValidationProcess" ) ;
281
-
282
- // if errors don't send the form
283
- if ( ruleViolationsByField . length > 0 ) {
284
- event . preventDefault ( ) ;
285
- }
286
- } ) ;
259
+ } ) ;
260
+
261
+ JSValidator . Utils . _bindEvent ( instance . formElement , "submit" , function ( event ) {
262
+
263
+ // Do preValidation
264
+ instance . _doAction ( event , null , "preSubmitValidationProcess" ) ;
265
+
266
+ var validate = true ;
267
+ instance . getFields ( ) . forEach ( function ( field ) {
268
+ field . _doValidateField ( event , field , function ( ruleViolation ) {
269
+ var ruleViolationsByField = [ ] ;
270
+
271
+ if ( ruleViolation . length > 0 ) {
272
+ validate = false ;
273
+ ruleViolationsByField . push ( {
274
+ field : field . name ,
275
+ ruleViolations : ruleViolation
276
+ } )
277
+ }
278
+
279
+ // Do postValidation
280
+ instance . _doAction ( event , ruleViolationsByField , "postSubmitValidationProcess" ) ;
281
+
282
+ // if errors don't send the form
283
+ if ( ruleViolationsByField . length > 0 ) {
284
+ event . preventDefault ( ) ;
285
+ }
287
286
} ) ;
288
- } , false ) ;
287
+ } ) ;
288
+ } , false ) ;
289
289
290
290
return instance . actions ;
291
291
} ,
0 commit comments