W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2006

[whatwg] [WF2] <select required>

From: Simon Pieters <zcorpan@hotmail.com>
Date: Wed, 04 Oct 2006 00:32:27 +0000
Message-ID: <BAY109-F34060C84B5AB9C6274445FB41D0@phx.gbl>
Hi,

From: Robert <mail@robbiegee.com>
>On Mon, 02 Oct 2006 16:35:32 +0200, Simon Pieters <zcorpan at hotmail.com>  
>wrote:
>Submitting an empty value may be wanted,

Then don't mark the select as being required. Or do you mean that there are 
cases where the user has to change the value to ""? What would that be?

>and since a select by definition  is a list of predefined valid values, it 
>would make little sense to  prevent the user from selecting some of them.

In practice they are prevented today (with script). The most common way to 
do this (from what I've seen) is to use "" as value for the first option, 
and then check the value with script (either client side or server side, 
although on the client side you could check for selectedIndex instead).

>However, I agree with the  use case of the invalid starter value so users 
>must consciously select a  value they wanted instead of the default one.

So should there be a declarative way to express this?

Regards,
Simon Pieters
Received on Tuesday, 3 October 2006 17:32:27 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:29 UTC