Terrence Wood wrote:

<!-- top of page -->
<p>Sorry, we were unable to process this form. Please check your value for <label for="foo">foo</label>.</p>

<!-- snip, later in the page -->
<label for="foo">Foo <input type=text id="foo" name="foo" /></input>

clicking the label in the error message focuses the form control. The draw back is that you need to wrap the entire page in a form, instead of having it contained in a smaller block.

I'd be careful with multiple labels when it comes to screenreaders as well. Need to do some testing, but I suspect it would possibly read all labels associated with a form element in source order (in your case, possibly "foo foo"). On the other hand, screenreaders may just read the last one in the series, which can also cause problems when relying on the "multiple label" method to provide different bits of label in different parts of the page, e.g.

<label for="name">Your name
    <input type="text" id="name" name="name" />
</label>

and later on

<label for="name">(required field)</label>

Ideally you want "Your name (required)", but screenreaders may read one or the other.

As I said, needs testing, but just a word of caution...

--
Patrick H. Lauke
__________________________________________________________
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
__________________________________________________________
Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
__________________________________________________________

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to