W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2000

Re: HTMLSelectElement should not have a "value" attribute

From: ValerieGSharp <ValerieGSharp@netscapeonline.co.uk>
Date: Thu, 05 Oct 2000 18:13:32 +0100
Message-ID: <39DCB6BC.23789A0B@netscapeonline.co.uk>
To: Adam Dingle <adam@avantgo.com>
CC: "'www-dom@w3.org'" <www-dom@w3.org>
> Adam Dingle wrote:
> 
> In both the DOM Level 1 and Level 2 specifications, the
> HTMLSelectElement interface has a "value" attribute.  I believe this
> to be an error, as evidenced by all of the following:
> 
> - The SELECT element in HTML 4.01 has no "value" attribute.

You'll need someone more expert than me to give you a definitive answer,
but I've used the 'onchange' attribute of SELECT to indicate when a new
OPTION is selected, and this _has_ to assume that SELECT has a value.

It's true that HTML4.01 doesn't explicitly specify a value attribute for
SELECT, but it does seem to be implied:

'Menu' is a control type. (HTML4.01 17.2.1)
  
SELECT has a 'control name'. (HTML4.01 17.6)

"Each control has both an initial value and a current value, both of
which are character strings" (HTML4.01 17.2)

And SELECT may have an 'onchange' attribute which implies a value.
(HTML4.01 17.6)

But there's no mention of what the value represents, nor of what the
initial or default values might be.

However, checking in IE5 and Mozilla, the value of SELECT does indeed
return a string corresponding to the value of the currently selected
OPTION.


> - The Netscape JavaScript documentation does not list a "value"
> property for Select objects (see
> http://developer.netscape.com/docs/manuals/js/client/jsref/select.htm
> ).

Useful though it may be, I'd hesitate to regard it as definitive.

<snip>

> - The description of HTMLSelectElement's "value" attribute in the DOM
> specification is hopelessly vague: it reads "the current form control
> value".

Probably wouldn't be a problem if HTML4.01 had been more explicit.

<snip>


-- 
Regards,
Val Sharp - Edinburgh
Received on Thursday, 5 October 2000 13:15:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT