WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Long form legends

for

From: Richard Garbutt
Date: Jun 10, 2005 3:19PM


On 06/06/05, Joelle Tegwen < <EMAIL REMOVED> > wrote:
> I'm going to talk to our designers about moving from two radios to one
> checkbox, thus eliminating a lot of our needed fieldsets. But we have over
> 70 activities and they all have fieldsets. I just gave 1 example.
>
> But I do have many cases where I have things like:
> List 5 people that can help you with this:
> 1. <input type="text">
> 2. <input type="text">
> 3. <input type="text">
> 4. <input type="text">
> 5. <input type="text">
>
> And these clearly qualify for a fieldset/legend.
>
> We *must* be accessible to screen readers (our mission is to support people
> with disabilities) so the "List 5 people.." needs to be associated with the
> 1, 2, 3, 4 & 5. His example only associates the "List 5 people..." with the
> 1st control.
>

What about the <label> tag?

Something like this may solve your problem:

<fieldset>
<legend>List 5 people that can help you with this:</legend>
<label for="p1">1st Person</label>
<input id="p1" type="text" />
<label for="p2>2nd Person</label>
<input id="p2" type="text" />
<label for="p3">3rd Person</label>
<input id="p3" type="text" />
<label for="p4">4th Person</label>
<input id="p4" type="text" />
<label for="p5">5th Person</label>
<input id="p5" type="text" />
</fieldset>

I think the context is clear enough to avoid people entering "I",
"You" and "She" in the first three fields.

-Richard