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:

	<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>

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
Received on Thursday, 24 April 2008 09:36:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:20 UTC