Label element 'for' attribute question
E.J. Zufelt
everett at zufelt.ca
Wed Mar 25 14:29:02 UTC 2009
Good morning,
It's not that the fieldset and legend elements need to replace the
label elements here, but the will supplement the label element. If
the checkboxes are all pertaining to the same topic then this would be
the best approach.
As for how it sounds, each AT treats this differently. Some ATs
ignore the fieldset/legend altogether, some speak the legend (label)
when you tab to the first control in a fieldset, but not for the
subsequent controls, others sspeak the legend for each control in the
fieldset.
For instance, for the following code JAWS would speak "Group of
Checkboxes, checkbox 1"
<fieldset>
<legend>Group of Checkboxes</legend>
<input type=checkbox" id="cb1" />
<label for="cb1">Checkbox 1</label>
</fieldset>
HTH,
Everett
On 25-Mar-09, at 10:52 AM, Michael S Elledge wrote:
> That's an interesting idea, Eli! I've only seen fieldset and legend
> used for grouping similar questions within a form, not for elements
> within a question. How does it sound with a screen reader?
>
> Mike
>
> Eli Cochran wrote:
>> I think that the way to handle this is not with a label tag at all
>> but the <fieldset> and <legend> tags which are a standard way to
>> group form elements together.
>>
>> There are some standard styles applied to these elements which
>> should be overridden by our css-reset.
>>
>> - Eli
>>
>> On Mar 24, 2009, at 10:37 AM, Anastasia Cheetham wrote:
>>
>>>
>>> I have a question about best practices around the 'for' attribute
>>> on a <label> element.
>>>
>>> UI Options has a group of checkboxes for how to highlight links.
>>> Each of the checkboxes has its own label, and the 'for' attributes
>>> reference the relevant input fields. However, the collection of
>>> checkboxes also has a label.
>>>
>>> Does anyone know how to associate the 'group' <label> with the
>>> collection of checkboxes? I've checked the WCAG guidelines, but
>>> they've not been helpful.
>>>
>>> --Anastasia Cheetham a.cheetham at utoronto.ca
>>> Software Designer, Fluid Project http://fluidproject.org
>>> Adaptive Technology Resource Centre / University of Toronto
>>>
>>> _______________________________________________________
>>> fluid-work mailing list - fluid-work at fluidproject.org
>>> To unsubscribe, change settings or access archives,
>>> see http://fluidproject.org/mailman/listinfo/fluid-work
>>
>> . . . . . . . . . . . . . . . . . . .
>>
>> Eli Cochran
>> user interaction developer
>> ETS, UC Berkeley
>>
>>
>> _______________________________________________________
>> fluid-work mailing list - fluid-work at fluidproject.org
>> To unsubscribe, change settings or access archives,
>> see http://fluidproject.org/mailman/listinfo/fluid-work
>>
>>
> _______________________________________________________
> fluid-work mailing list - fluid-work at fluidproject.org
> To unsubscribe, change settings or access archives,
> see http://fluidproject.org/mailman/listinfo/fluid-work
More information about the fluid-work
mailing list