File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 47
47
// Toggle form state depending on if it has only valid inputs or not.
48
48
$formsToDisable
49
49
. addClass ( showErrorDialogs ? 'disabled-with-errors' : 'disabled-without-errors' )
50
+ . on ( 'reset' , function ( ) {
51
+ toggleFormState ( $ ( this ) , 'disabled' ) ;
52
+ } )
50
53
. find ( '*[data-validation]' )
51
54
. valAttr ( 'event' , 'keyup change' )
52
55
. on ( 'validation' , function ( evt , valid ) {
62
65
}
63
66
} )
64
67
. on ( 'afterValidation' , afterValidationCallback )
65
- . on ( 'reset' , function ( ) {
66
- toggleFormState ( $ ( this ) , 'disabled' ) ;
67
- } )
68
68
. on ( 'blur' , function ( ) {
69
69
$ ( this ) . valAttr ( 'have-been-blurred' , 1 ) ;
70
70
} ) ;
Original file line number Diff line number Diff line change 34
34
35
35
< div class ="form-group ">
36
36
< button type ="submit "> Login</ button >
37
+ < button type ="reset "> Reset</ button >
37
38
</ div >
38
39
39
40
</ form >
40
41
</ div >
41
42
42
43
< script src ="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js "> </ script >
43
- < script src ="../form-validator/jquery.form-validator.js "> </ script >
44
+ < script src ="../form-validator/jquery.form-validator.min. js "> </ script >
44
45
< script >
45
46
46
47
$ . validate ( {
47
- modules : 'toggleDisabled' ,
48
+ modules : 'security, toggleDisabled' ,
48
49
onSuccess : function ( ) {
49
50
alert ( 'valid' ) ;
50
51
return false ;
You can’t perform that action at this time.
0 commit comments