WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: form label question

for

From: Jared Smith
Date: Aug 9, 2007 11:00PM


On 8/9/07, Sawang Srisom wrote:

> <label for="gender1 gender2">Gender</label>
> <input type="radio" name="gender" id="gender1" value="Male"
> checked="checked" /> Male<br />
> <input type="radio" name="gender" id="gender2" value="Female"
> checked="checked" /> Female

In this case, "Male" and "Female" should be the labels for their
appropriate radio buttons. "Gender" should not be marked up as a
label. It could and probably should, however, be a legend for a
fieldset that surrounds the two radio buttons.

Examples and proper coding at http://webaim.org/techniques/forms/controls.php

I think what we're all saying is that labels are necessary for
accessibility. There are few cases when they might pose design and
usability issues and in those cases, it must be visually and
programmatically (through title, row/column headers, etc.) apparent
what the function of the form element is.

Jared Smith
WebAIM