WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Error Messaging with Forms: Associated Controls, One with Title Attribute, One with Label

for

From: Tim Harshbarger
Date: Sep 12, 2011 6:45AM


Elle,

If I am understanding the situation correctly, I am uncertain that the aria-invalid attribute by itself is enough. I would suggest using something like aria-describedby or aria-labeledby to associate the error message with the field. Also, if you want to ensure someone using a screen reader knows how many errors are on the form, you could place a hidden message above the form and also associate it with the fields that have errors--or make it a live region so when the message is added to the DOM, it is read by a screen reader. If you don't wish to use ARIA for solving this problem, you are pretty much stuck with using either the label element or the title attribute to get the information across.

I wish you luck. Good accessible error handling on complex forms often does seem to present interesting challenges.