[whatwg] [Web Forms 2.0] 2.3. Extensions to the select element - comment & proposal

Ian Hickson ian at hixie.ch
Wed Oct 29 00:51:17 PDT 2008

On Mon, 27 Aug 2007, Garrett Smith wrote:
> Currently there is a problem in at least Firefox, and I can't remember 
> about IE. If no OPTION has selected attribute, then Firefox will select 
> the first option in the list. If the first option is selected, it's 
> selected attribute will be true and the defaultSelected will be false. 
> This is because defaultSelected is required to return the value of the 
> HTML selected attribute.
> The negative result this has is that it causes the form to appear dirty.

To work around this, manually mark the first element as selected.

I think it isn't a bug that it marks the form as dirty (as it were); the 
data that the server sent is that nothing was selected, yet the client 
would submit a value. This is a difference and it is right to act as if it 
is a difference, IMHO.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list