File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 2929 // wire up the default jquery validation event to the form
3030 this . validate ( options ) ;
3131
32- // Select any input[type=text] elements within a validation group
32+ // Select all input elements in form
3333 // and attach keydown handlers to all of them.
3434 $ ( '.form :input' ) . keydown ( function ( event ) {
35- // Only execute validation if the key pressed was enter.
35+ // Cause the form to validate when the enter key is pressed.
36+ // It is a requirement to catch the enter key press as the default
37+ // browser action would submit the form bypassing the validation event thus validating all groups.
3638 if ( event . keyCode == 13 ) {
3739 $ ( event . currentTarget ) . closest ( ".form" ) . find ( ".submit" ) . click ( ) ;
3840 return false ;
8082 }
8183 } ) ;
8284
83- } ) ( jQuery ) ;
85+ } ) ( jQuery ) ;
You can’t perform that action at this time.
0 commit comments