[whatwg] [WF2] <select required>

Weston Ruter westonruter at gmail.com
Fri Oct 24 12:58:23 PDT 2008


Kristof, you are right. This is not implemented in IE 7. However, Microsoft
has implemented it in IE 8 Beta 2; that's what I tested in.


On Fri, Oct 24, 2008 at 12:52 PM, Kristof Zelechovski <giecrilj at stegny.2a.pl
> wrote:

>  The official documentation for the disabled Property (BUTTON, INPUT
> type=button, INPUT type=checkbox, ...)<http://msdn.microsoft.com/en-us/library/ms533732%28VS.85%29.aspx>:
> contains the following:
>
> *Note*  For OPTGROUP<http://msdn.microsoft.com/en-us/library/ms535876%28VS.85%29.aspx>and
> OPTION <http://msdn.microsoft.com/en-us/library/ms535877%28VS.85%29.aspx>,
> the functionality specified by the HTML 4.0<http://www.w3.org/tr/rec-html40/>
>  [image: World Wide Web link] standard is not currently implemented. You
> can define your own functionality.
>
>
>  ------------------------------
>
> *From:* whatwg-bounces at lists.whatwg.org [mailto:
> whatwg-bounces at lists.whatwg.org] *On Behalf Of *Weston Ruter
> *Sent:* Friday, October 24, 2008 9:40 PM
> *To:* whatwg at whatwg.org
> *Cc:* Ian Hickson; Tab Atkins Jr.; Joao Eiras; Simon Pieters; Robert
> *Subject:* Re: [whatwg] [WF2] <select required>
>
>
>
> I just realized that there is existing support for using a first OPTION as
> a non-selectable hint value. Instead of this:
>
> <select>
>   <option value="[[invalid]]">Select one</option>
>   <option value="">None of these</option>
>   <option value="love it">Love It</option>
>   <option value="hate it">Hate It</option>
> </select>
>
>
> One may set two attributes, @disabled and @selected, on the first OPTION:
>
> <select>
>   <option disabled selected>Select one</option>
>   <option value="">None of these</option>
>   <option value="love it">Love It</option>
>   <option value="hate it">Hate It</option>
> </select>
>
>
> The behavior in browsers is that "Select one" is displayed as the value in
> the drop-down, and in MSIE it's even grayed out. In Firefox and MSIE, since
> the default selected option is disabled, it will not submit a value. In this
> case, the option's @value makes no difference and can be an empty string or
> any value at all. (Note that Firefox is a little buggy in that when clicking
> on the select list, the shown selected option won't change but the value
> submitted will change to the first non-disabled value.) Unfortunately,
> Safari and Opera submit the disabled option, even though it cannot be
> selected by hand. In IE and Firefox, once the one of the options is selected
> by the user, they are unable to re-select the disabled option, as with
> Safari and Opera.
>
> Here's a demo:
> http://weston.ruter.net/projects/test-cases/html-select-element/
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081024/7357461c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 117 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081024/7357461c/attachment-0001.gif>


More information about the whatwg mailing list