W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > October to December 2003

Re: label tag and multiple associations

From: Charles McCathieNevile <charles@sidar.org>
Date: Wed, 26 Nov 2003 16:45:59 +0900
Cc: w3c-wai-ig@w3.org
To: Kieran_M_O'Brien@national.com.au
Message-Id: <937565FD-1FE4-11D8-8C06-000A958826AA@sidar.org>

Hi Kieran,

in HTML you can't do this in the general case. The closest approach is 
to use the fieldseet and legend elements which are designed to do 
something like this. See 
http://www.w3.org/TR/html4/interact/forms.html#h-17.9 for where it says 
"Each LABEL element is associated with exactly one form control." and 
see http://www.w3.org/TR/html4/interact/forms.html#h-17.10 for fieldset 
and legend, which do what you are looking for.

There is a little hack that is often used of putting things in a table, 
where you can associate one cell with a number of others. A handful of 
screen readers present this information as if it were achieving your 
goal here. But you don't have a formal way of saying that the label 
applies to the form controls in particular, which is the checkpoint 
requirement as I understand it. In particular, unlie with 
fieldset/legend you have to do some nasty hacking to get an accesskey...

just my 2cents (Australian official value)


On Wednesday, Nov 26, 2003, at 15:24 Japan, 
Kieran_M_O'Brien@national.com.au wrote:

> Greetings,
> How do I associate more than one input field with one label ?? For 
> example,
> let's say I have a Telephone number field but have two boxes, i.e. one 
> for
> the area code and one for the actual number. Ignoring the fact that I 
> could
> have an area code label, is there a way of associating these two input
> boxes with the one label ?? Please don't question why I have done it 
> this
> way, or that I should redo it this way. I'm not interested in 
> workarounds.
> Just wondering if it is possible. Then I can go back to them to tell 
> them
> that they have to change it. Thanks in advance.
Received on Wednesday, 26 November 2003 02:46:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:26 UTC