validate form even if the form is submitted from an element within it

This commit is contained in:
Bo Peng 2021-03-02 12:40:33 -06:00
parent 4813982c1a
commit 962b540f0c

View File

@ -1661,7 +1661,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') {