mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-20 09:11:40 +01:00
Core: Properly handle nested cancel submit button
Fixes #1370 Closes #1423 Closes #1490
This commit is contained in:
@@ -28,13 +28,14 @@ $.extend($.fn, {
|
||||
if ( validator.settings.submitHandler ) {
|
||||
validator.submitButton = event.target;
|
||||
}
|
||||
|
||||
// allow suppressing validation by adding a cancel class to the submit button
|
||||
if ( $( event.target ).hasClass( "cancel" ) ) {
|
||||
if ( $( this ).hasClass( "cancel" ) ) {
|
||||
validator.cancelSubmit = true;
|
||||
}
|
||||
|
||||
// allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
|
||||
if ( $( event.target ).attr( "formnovalidate" ) !== undefined ) {
|
||||
if ( $( this ).attr( "formnovalidate" ) !== undefined ) {
|
||||
validator.cancelSubmit = true;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user