W3C home > Mailing lists > Public > www-validator@w3.org > October 2013

Re: The label element may contain at most one input, button, select, textarea, or keygen descendant.

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Tue, 01 Oct 2013 12:53:17 +0300
Message-ID: <524A9B8D.9080105@cs.tut.fi>
To: "Felix E. Klee" <felix.klee@inka.de>
CC: www-validator@w3.org
2013-10-01 11:07, Felix E. Klee wrote:

> On Tue, Oct 1, 2013 at 9:55 AM, Jukka K. Korpela <jkorpela@cs.tut.fi>
> wrote:
>> The construct
>>          <label>
>>            <input type="radio" />
>>            <input type="text" />
>>          </label>
>> would be rather odd, in addition to being invalid; the error
>> processing rule means that the radio button is the labeled control and
>> the text input control is its label!
> I don't want to argue, but: Lists or collections of radio buttons
> sometimes have a free-form option, in addition to predefined options.

You can have such an option, though it will be parallel to a group of 
radio buttons rather than part of it. The point is, anyway, that the 
free text input field is not a label for a radio button. Rather, you 
would have (after normal radio buttons) something like

<input id="other" type="radio" ...>
<label for="other">Other</label>,
<label for="custom">please specify:</label>
<input id="custom" type="text" ...>

Received on Tuesday, 1 October 2013 09:53:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:09 UTC