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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions