WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: A simple beginner's question

for

From: Léonie Watson
Date: May 23, 2016 6:35AM


> From: Birkir R. Gunnarsson [mailto: <EMAIL REMOVED> ]
> Sent: 23 May 2016 12:42
> aria-describedby is the best technique in my experience to relate error
> messages to form fields If your error checking happens when user submits
> the form you:
> 1. use aria-describedby to associate error message with form fields and 2.
> Move focus to the first form field with an associated error message.

You can do this, but if you're using aria-describedby to associate useful information with the field already, it can get messy. With something like an error, sticking to old-school HTML seems like the best option, if for no other reason than backwards compatibility.

Plenty of ways to "skin the cat" of course :)



Léonie.

--
@LeonieWatson tink.uk Carpe diem