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

RE: Question about form labels and radio buttons.

From: RUST Randal <RRust@COVANSYS.com>
Date: Tue, 12 Nov 2002 19:26:33 -0500
Message-ID: <1A729C6059E7CD4CA1DFE3985E600421142EB2@fth-ex02.CVNS.corp.covansys.com>
To: "Mirabella, Mathew J" <Mathew.Mirabella@team.telstra.com>, "'W3C-WAI-IG List'" <w3c-wai-ig@w3.org>

The name attribute is still valid for the INPUT element.
 
Create some markup with it in there and run it through the validator and
you'll pass just fine,
 
Randal

-----Original Message----- 
From: Mirabella, Mathew J [mailto:Mathew.Mirabella@team.telstra.com] 
Sent: Tue 11/12/2002 7:15 PM 
To: 'W3C-WAI-IG List' 
Cc: 
Subject: Question about form labels and radio buttons.




All. 

Maybe I am forgetting something simple here.  A quick question regarding 
labels for radio buttons in XHTML 1.0. 

Normally, name= attributes of the input elements are used to indicate the 
grouping.  i.e. name="sex" value="female".  And of course the value= 
attributes differ for each radio button to provide the name/value pair. 

However, in using the label element to associate the on-screen text as a 
label for the control, each radio button in fact has a different label. 
This is ok because we use the id= attribute to link each radio button to its

label. 
eg. 
        ...<label for="female">Female <input type="radio" name="sex" 
id="female" value="female" /></label>... 
        ...<label for="male">Male <input type="radio" name="sex" id="male" 
value="male" /></label>... 

The issue is that in XHTML 1.0, the name= attribute is replaced by the id= 
attribute.  So without the name= attribute, how do we: 
1.  Code the grouping of the controls with name/value pairs? (I assume that 
id takes over from name here??). 
2.  Create different explicitly associated labels for each radio button (an 
issue since now the id attribute has to reflect the grouping). 

In 2. above, do we suggest that the value= attribute takes over from the id=

attribute in its linking to the for= attribute of the label element?  If so,

how are user agents and technologies such as screen readers accommodating 
this? (since they normally use id/for links rather than value/for links 
between input and label elements). 

Do we now take radio buttons (and thus perhaps checkboxes as well) to be 
controls which in fact have explicit labels contained within them via the 
value= attribute (cf. submit and reset input types)?  If so, do we say that 
label elements are not required for radio buttons? 

The difficulty is that the real label for a radio button appears on the 
screen, and thus normally you would use label to connect the label to the 
control as with checkboxes and edit fields. 

Are we going down a path where we want user agents to render the contents of

the value= attribute on-screen?  Or do we just code our radio buttons 
without labels, and leave it to the adaptive technology to use value= 
attributes, ensuring that in the code, the on-screen label approximates (or 
is equivalent to) the value= attribute? 

Any information on this would be helpful. 

Mat. 
Received on Tuesday, 12 November 2002 19:27:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:14:07 GMT