Re: Radio and checkbox texts

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 UTC