WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Alternatives to LEGEND for a radio button?

for

From: D A
Date: Sep 4, 2009 12:20PM


> Perhaps I missed something, but why are you using
> headings in a form? Again I dont need useless
> chatter when filling out forms.

Well, I really hope it's not useless chatter. The reason we're using
them is in the scenario where you have a group of checkboxes or radio
buttons inside a fieldset.

Example:

Fieldset
Legend
Label | field
Label | field
H2 for checkboxes
label | checkbox
label | checkbox
label | checkbox

The issue is that the group of checkboxes will often need some sort of
'group heading'.

The problem with using a legend is two fold (it seems):

1) legends are nearly impossible to visual style with CSS with any
consistency in most browsers.

2) nested legends appear to add to the chatter issue.

I still haven't gotten a chance to try out Michael's suggestion of
using a tab index of 0, though. But I hope it work.

-Darrel