WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Focus for error messages


From: Rich Pedley
Date: Apr 19, 2007 12:50PM

On 19/04/2007 15:32, Jared Smith wrote:

> We implemented a method that seems to work pretty well. It doesn't
> do it 'live', but after the form is submitted. You can try it out
> at http://webaim.org/contact/ (just leave a field blank, no worries
> if you accidentally send a message). It uses javascript to visually
> highlight the error messages as well as set focus directly to the
> error message. Links then provide direct access to the relevant
> form fields, also with visual highlighting and focus set. It works
> well, even with javascript disabled.
> If anyone has feedback about this approach, please post it. I'm
> working on packaging up the script and PHP code for others to use,
> but want to make sure it works correctly.

Looks good, but could perhaps be improved. Currently on an error the
link provided goes directly to the input, Where as it would be better
going to the label. This may not be the best for accessibility, but
usability wise I feel it is better. *I* get confused when the label
for the relevant input isn't on the screen!!

Of course it could just be me, I'm usually slightly off beat with
these things :grin: