Inline validation sets errors on fields inside .novalidate
-
Fields inside a
.novalidateelement are left out of the form data invalidate()(includes/js/src/validate.js), but the loop that sets the errors does not skip them. They fail therequiredrule and show “Please fill out this field.”Steps to reproduce: create this form, then type something in
field-band leave the field.<div class="novalidate">[text* field-a]</div>
[text field-b]
[submit]Expected: no error on
field-a.Actual:
field-ashows “Please fill out this field.”Fix: skip
.novalidatewraps in the loop that sets the errors:for (const wrap of wrapList) {
if (undefined === wrap.dataset.name) {
continue;
}
// add this:
if (wrap.closest(".novalidate")) {
continue;
}Tested with 6.2.
PS: Seems like I’m blocked from creating issues on the github repo https://github.com/rocklobster-in/contact-form-7. Would you consider allowing me to post issues and PRs in your github repo? My github name is pwkip.
You must be logged in to reply to this topic.