[whatwg] How not to fix HTML

Lachlan Hunt wrote:
> I believe the issue is with the way screen readers handle existing 
> forms.  The problem is that each radio button or checkbox has it's own 
> label, but the whole group is often associated with a single question 
> and there is no way mark that up.
> 
> e.g.
> 
> <p>Gender:
>    <label for="m"><input type="radio" id="m" name="gender" value="m">
>      Male</label>
>    <label for="f"><input type="radio" id="f" name="gender" value="f">
>      Female</label>
> </p>

   Here's a thought:

| <p>
|   <grouplabel for="gender">Gender:</grouplabel>
|    <label><input type="radio" name="gender" value="m">Male</label>
|    <label><input type="radio" name="gender" value="f">Female</label>
| </p>

   The element <grouplabel> gives the label for the group. The |for|
attribute in this case takes a name rather than and ID, therefore it
labels as a group control elements that have |name="gender"| as an
attribute. It introduces only one element and one attribute for an
unlimited amount of control elements.

Received on Tuesday, 31 October 2006 18:33:12 UTC