W3C home > Mailing lists > Public > www-validator@w3.org > May 2005

Re: radio button validation?

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Wed, 11 May 2005 06:26:41 +0300 (EEST)
To: Bill Fenner <fenner@gmail.com>
Cc: www-validator@w3.org
Message-ID: <Pine.GSO.4.58.0505110622280.19339@korppi.cs.tut.fi>

On Tue, 10 May 2005, Bill Fenner wrote:

> http://www.w3.org/TR/html4/interact/forms.html#radio says that
> 'authors should ensure that in each set of radio buttons that one is
> initially "on".'

That's a good principle, which most authors are not aware of.

> Is there any way to get the validator to check for conditions like this?

Unfortunately not. The principle is not expressible in a DTD. Setting a
radio button initially "on" is done by using a 'checked' attribute, which
is declared as optional. If you declared it as required in your DTD, it
would be required in every <input> element. We cannot make the
requiredness depend on the presence of other attributes (such as 'type' in
this case) in the same element, or on other elements in the same document.
So on two accounts, it's impossible.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Wednesday, 11 May 2005 03:26:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:19 GMT