Improve Email field validation error message to improve accessibility

Created on 17 February 2020, almost 5 years ago
Updated 28 June 2023, over 1 year ago

Problem/Motivation

Hi,

We had an accessibility audit and one of the issues was that the error message for email fields was not helpful enough and should contain something about the format it expects. Personally I disagree and think the message is good enough, but perhaps it is worth to look into.

I decided to create a patch instead of overriding the email class because the latter would not keep track of any possible future changes to the Email field.

Sincerely,

Dagomar

Proposed resolution

The current email field validation error message doesn't contain anything about the email format, So add a sample format in the error message
Current error message
"The email address abc.@in is not valid."

Proposed error message
"The email address abc.@in is not valid. Use the format user@example.com."

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Field 

Last updated 31 minutes ago

Created by

🇳🇱Netherlands dagomar

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024