Skip to content

Commit 328efc9

Browse files
committed
Core: Properly handle nested cancel submit button
Fixes jquery-validation#1370 Closes jquery-validation#1423 Closes jquery-validation#1490
1 parent db877eb commit 328efc9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ $.extend($.fn, {
2828
if ( validator.settings.submitHandler ) {
2929
validator.submitButton = event.target;
3030
}
31+
3132
// allow suppressing validation by adding a cancel class to the submit button
32-
if ( $( event.target ).hasClass( "cancel" ) ) {
33+
if ( $( this ).hasClass( "cancel" ) ) {
3334
validator.cancelSubmit = true;
3435
}
3536

3637
// allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
37-
if ( $( event.target ).attr( "formnovalidate" ) !== undefined ) {
38+
if ( $( this ).attr( "formnovalidate" ) !== undefined ) {
3839
validator.cancelSubmit = true;
3940
}
4041
});

0 commit comments

Comments
 (0)