mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-20 09:11:40 +01:00
Bypass validation for buttons with 'formnovalidate' attribute (same as class="cancel"). Closes gh-623
This commit is contained in:
committed by
Jörn Zaefferer
parent
ff26f320c6
commit
bcff73ad84
5
jquery.validate.js
vendored
5
jquery.validate.js
vendored
@@ -45,6 +45,11 @@ $.extend($.fn, {
|
||||
if ( $(event.target).hasClass("cancel") ) {
|
||||
validator.cancelSubmit = true;
|
||||
}
|
||||
|
||||
// allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
|
||||
if ( $(event.target).attr("formnovalidate") !== undefined ) {
|
||||
validator.cancelSubmit = true;
|
||||
}
|
||||
});
|
||||
|
||||
// validate the form on submit
|
||||
|
||||
Reference in New Issue
Block a user