Joshua Street wrote:

This one has always confused me. There is a linear relationship
between a field's label and the field proper, yes, but how does one
mark that up as a table?

I believe Lachlan was referring to a construct like

<tr>
    <th scope="row"><label for="name">Name</label></th>
    <td><input type="text" name="name" id="name" /></td>
</tr>

> SHOULD that be marked up as a table?

That's one of those debatable subjects...mostly comes down to your particular interpretation of the structural/semantic nature of tables and forms.
For my own part, I sit on the fence on this one...

I consider, in that case, <label [for=""]> to be mostly adequate, but
there are situations where it is not (for example, where is the
semantic sense in associating one label with two fields, as is the
case wherever input type="radio" is used).

You've lost me there. Do you mean in general, or when using a table to
lay out a form? In general, the correct markup would be along the lines of:

<fieldset>
    <legend>What's your favourite colour?</legend>

    <input type="radio" name="colour" id="colour_black" value="black" />
    <label for="colour_black">black</label>

    <input type="radio" name="colour" id="colour_white" value="white" />
    <label for="colour_white">white</label>
</fieldset>

or variations where you can, for instance, wrap the input inside the label itself...but, for "belt and braces", also keep the label's for attribute and the input's id in there:

<label for="colour_black"><input type="radio" name="colour" id="colour_black" value="black" /> black</label>

A label can't be associated with more than one form control (though a form control may be targetted by separate, discrete label elements, all with the same for attribute pointing at the form control's id).

--
Patrick H. Lauke
__________________________________________________________
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
__________________________________________________________
Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
__________________________________________________________
******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to