WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: role="alert" not being read on page load

for

From: Mohith BP
Date: Jun 16, 2019 11:59PM


Hi Joseph Sherman,

The error or success message of action such as form submission need to
be communicated to the user immediately. Hence just posting error
message somewhere is not a good practice.
Please improve the alert region as suggested by Bryan Garaventa.
Note: the element containing aria live regions such as role alert,
aria-live polite or assertive need to be there in the DOM and the text
need to be injected through script. Still if it is not reading then
provide 1 second (1000 ms) delay before injecting the text.
If you are dynamically creating the element then also there need to be
delay from creating the element and injecting the text.

If you have multiple errors on the form it is good to list out all the
errors in the beginning of the form with link to the form field.
Ensure specific error message for each form field is programmatically
associated with the form field with aria-describedby and set the focus
to the list of errors or the first error field based on your
implementation.


Thanks & Regards,
Mohith B. P.

On 6/14/19, Joseph Sherman < <EMAIL REMOVED> > wrote:
> Hello. I have a form where after the user submits incorrect information, the
> page refreshes with an error message with role="alert". However I find the
> error text is not being read in FireFox with JAWS or NVDA. Code below. Are
> we doing something wrong?
>
> <div role="alert" class="alert alert-error alert-danger">
> <ul><li>More than one user was found that matches the information you
> provided. Please contact your college support team and tell them you
> received this error.</li></ul></div>
>
>
>
> Joseph
>
> > > > >