Merge pull request #400 from BoPeng/submit

Perform form validation even if the form is submitted by an element within it
This commit is contained in:
1cg 2021-03-06 09:53:55 -07:00 committed by GitHub
commit 24b854723b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1665,7 +1665,7 @@ return (function () {
var errors = [];
// only validate when form is directly submitted and novalidate is not set
var validate = matches(elt, 'form') && elt.noValidate !== true;
var validate = (matches(elt, 'form') || closest(elt, 'form')) && elt.noValidate !== true;
// for a non-GET include the closest form
if (verb !== 'get') {