W3C home > Mailing lists > Public > www-html@w3.org > September 2005

Form elements discrepancy

From: Ming Teo <ming@staff.highway1.com.au>
Date: Fri, 30 Sep 2005 05:46:40 +0000
Message-ID: <433CB2A3.9070804@staff.highway1.com.au>
To: www-html@w3.org
To Whom It May Concern:

My name is Ming Teo, I work as a front-end developer in Perth, Western 
Australia.

I had a concern regarding the use of checkboxes and radio buttons. 
Firstly, as every form element should have a label with attribute 
for="form_element", and every input thus has a name with attribute 
name="form_element", the use of checkboxes and radio buttons fails.

<label for="choose">First Option</label> <input type="radio" 
name="choose" value="First Option" />
<label for="choose">Second Option</label> <input type="radio" 
name="choose" value="Second Option" />

and the same for checkboxes:

<label for="choose">First Option</label> <input type="checkbox" 
name="choose" value="First Option" />
<label for="choose">Second Option</label> <input type="checkbox" 
name="choose" value="Second Option" />

However, implemented like select boxes:
<label for="choose">Choose one:</label>
<radio name="choose">
    <option value="First Option">First Option</option>
    <option value="Second Option">Second Option</option>
</radio>

and the same for checkboxes:
<label for="choose">Choose one:</label>
<checkbox name="choose">
    <option value="First Option">First Option</option>
    <option value="Second Option">Second Option</option>
</checkbox>

... meets the requirements of no two labels have the same for attribute 
value, and no two inputs have the same name.

While I'm on the subject, <option value="First Option" /> makes more 
sense also.

Thank you for your time, sorry if this sounds a lot like a complaint :)

-- 

*Guan Ming Teo*
Web Developer Highway 1

Highway 1 Internet Solutions
Level 2, 33 Richardson St.
WEST PERTH  WA  6005
Australia

http://www.highway1.com.au/
Received on Friday, 30 September 2005 22:55:01 GMT

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