I don't use powermail client validation as i use Bootstraps validation.
However, if I install powermail_cond, browser validation messages are triggered on invalid forms even if they have a novalidate attribute.
This is caused by this.#form.reportValidity() in #hasValidationErrors().
Wouldn't it be better to use this.#form.checkValidity()? This would check the form's validity in the same way without triggering browser validation messages. Even better, it could check for novalidate on the form and use the appropriate method.
|
#hasValidationErrors() { |
|
if (!this.#form.reportValidity()) { |
|
return true; |
|
} |
|
if (this.#form.classList.contains('powermail_form_error')) { |
|
return true; |
|
} |
|
return false; |
|
} |
I don't use powermail client validation as i use Bootstraps validation.
However, if I install powermail_cond, browser validation messages are triggered on invalid forms even if they have a
novalidateattribute.This is caused by
this.#form.reportValidity()in#hasValidationErrors().Wouldn't it be better to use
this.#form.checkValidity()? This would check the form's validity in the same way without triggering browser validation messages. Even better, it could check fornovalidateon the form and use the appropriate method.powermail_cond/Resources/Public/JavaScript/PowermailCondition.js
Lines 107 to 115 in bf50dc8