The <label>

I might be a little early on the discussion here, as it seems the  
spec is missing this part, in regards to the <label> tag:

<http://dev.w3.org/cvsweb/~checkout~/html5/spec/Overview.html? 
rev=1.171&content-type=text/html;%20charset=iso-8859-1#the-label>

Where it states "See WF2 for now" (Web Forms 2.0).

Anyway, I have recently been working on a website where the fields  
(radio) were presented in a tabular layout... its one of those "rate  
out of 5" types where the thing to be rated is set per row, and the  
columns are the radio fields 1 to 5.

Technically its possible to have used a drop down menu (select),  
however we had a design to match.

While developing it, I was hoping to have the headers effectively be  
the labels, instead of having to write out an off-screened label for  
each field.

I know its technically possible (although current screen readers  
don't really support it), to give an input field multiple labels...  
which was one part to the problem... however in HTML4 "the for  
attribute associates a label with another control explicitly"... so I  
could not assign the label to multiple input fields.

<http://www.w3.org/TR/html4/interact/forms.html#h-17.9.1>

What I am proposing is that the @for attribute can take multiple,  
space separated, id's to list the related fields... in the same was  
that the @class attribute can take multiple CSS classes.

---

Also, on perhaps an un-related note... I am not too keen on the use of:

<label>Name <input... /></label>

I know this is implicit linking of the field to the label, without  
the need for the @for attribute... but I was under the impression  
that xml cascades the meaning down to child nodes, so does this imply  
that the <input>, a field, is also a label?

For me it just seems like a hack to increase the hit area in visual  
browsers.

Craig

Received on Saturday, 4 August 2007 17:51:14 UTC