W3C home > Mailing lists > Public > www-html@w3.org > April 2008

Re: Radio and checkbox texts

From: David Dorward <david@dorward.me.uk>
Date: Thu, 24 Apr 2008 10:35:48 +0100
Message-Id: <A37D6B4F-EA06-417B-81DA-851C85486CFB@dorward.me.uk>
To: w3-html <www-html@w3.org>


On 24 Apr 2008, at 10:13, Anas R. wrote:
> My theory is something like this:
>
> <label>Gender:</label>
> <input name="gender" value="male" type="radio">Male</input>
> <input name="gender" value="female" type="radio">Female</input>

The current syntax, which is supported by browsers, is:

<fieldset>
	<legend>Gender</legend>
	<input name=gender value=male type=radio id=gender_m>
	<label for=gender_m>Male</label>
	<input name=gender value=female type=radio id=gender_f>
	<label for=gender_f>Female</label>
</fieldset>

I don't see any benefits, except a little brevity, over staying with  
the current system.

> - Does "for" attribute in 'label' tag perform any real function? I  
> don't think so!

HTML is a document description language, not a functional one, it just  
provides data.

What browsers do with that data is up to them. I don't know any  
graphical browser (in common use today) that doesn't extend the click  
target of an input onto the label associated with it via the for  
attribute. I'm told that without labels, screen readers may ignore  
text, or associate it with the wrong form control.

> - I think we should deal with radio text as the 'targget object'  
> wich has an attribute called "radio button"


We already have a generic system for associating labels with form  
controls, we don't need a specific one just for radio buttons.

-- 
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Received on Thursday, 24 April 2008 09:36:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:13 GMT