Skip to content

#hasValidationErrors() triggers native Browser validation messages for novalidate forms #124

Description

@bavarianbytes

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions