I just realized that there is existing support for using a first OPTION as a non-selectable hint value. Instead of this:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
&lt;select&gt;<br>

&nbsp; &lt;option value=&quot;[[invalid]]&quot;&gt;Select one&lt;/option&gt;<br>
&nbsp; &lt;option value=&quot;&quot;&gt;None of these&lt;/option&gt;<br>

&nbsp; &lt;option value=&quot;love it&quot;&gt;Love It&lt;/option&gt;<br>

&nbsp; &lt;option value=&quot;hate it&quot;&gt;Hate It&lt;/option&gt;<br>

&lt;/select&gt;<br></blockquote><br>One may set two attributes, @disabled and @selected, on the first OPTION:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
&lt;select&gt;<br>&nbsp; &lt;option disabled selected&gt;Select one&lt;/option&gt;<br>&nbsp; &lt;option value=&quot;&quot;&gt;None of these&lt;/option&gt;<br>


&nbsp; &lt;option value=&quot;love it&quot;&gt;Love It&lt;/option&gt;<br>


&nbsp; &lt;option value=&quot;hate it&quot;&gt;Hate It&lt;/option&gt;<br>&lt;/select&gt;<br></blockquote><br>The behavior in browsers is that &quot;Select one&quot; is displayed as
the value in the drop-down, and in MSIE it&#39;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&#39;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&#39;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. <br><br>Here&#39;s a demo: <a href="http://weston.ruter.net/projects/test-cases/html-select-element/">http://weston.ruter.net/projects/test-cases/html-select-element/</a><br>
<br>I also include on that page a proposed &quot;unselected&quot; attribute for the SELECT element. By default, a first option in a SELECT is selected; the only way to select no OPTION        is to set select.selectedIndex = -1. It would seem quite useful if some non-scripting means of doing this; perhaps an &quot;unselected&quot; boolean attribute would make sense. Unfortunately, WebKit still submits the first OPTION as the value even if the selectedIndex == -1. <br>
<br>Regarding the original topic of this thread, the select@required attribute, when select.selectedIndex == -1 (whether set programmatically or via some &quot;unselected&quot; boolean attribute), a @required attribute absolutely makes sense. It also absolutely makes sense with select@multiple.<br>
<br><br><div class="gmail_quote">On Fri, Oct 24, 2008 at 11:14 AM, Tab Atkins Jr. <span dir="ltr">&lt;<a href="mailto:jackalmage@gmail.com">jackalmage@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote"><div><div></div><div class="Wj3C7c">On Fri, Oct 24, 2008 at 11:57 AM, Andy Lyttle <span dir="ltr">&lt;<a href="mailto:whatwg@phroggy.com" target="_blank">whatwg@phroggy.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Oct 24, 2008, at 8:23 AM, Tab Atkins Jr. wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So, pulling it all together, my proposal for a hinting ability on &lt;select&gt; is thus:<br>
<br>
&lt;select&gt; can have a @hint attribute, which takes a text value. &nbsp;If there is no &lt;option @selected&gt;, then this hint is initially displayed in the &lt;select&gt;&#39;s collapsed state. &nbsp;As soon as an option is selected, though (or if an &lt;option&gt; had @selected initially), the hint disappears and the selected &lt;option&gt;&#39;s text is instead displayed in the &lt;select&gt;&#39;s collapsed state. &nbsp;When @hint is supplied, a conforming UA will not allow the form to be submitted until an option is selected (again, an &lt;option&gt; with @selected specified counts here), indicating in some way that a value in the &lt;select&gt; must be chosen (the exact method UAs use to indicate this to users is left undefined, but should be similar to how the UA alerts a user that an &lt;input&gt; with @required is empty and must be filled).<br>


<br>
For fallback, authors should provide an empty &lt;option&gt; (or one containing only whitespace) with an appropriate default @value as the &lt;select&gt;&#39;s first child. &nbsp;If &lt;optgroup&gt;s are used, this &lt;option&gt; should come before them. &nbsp;Conforming UAs will not display this &lt;option&gt;. &nbsp;In legacy UAs, this will cause the &lt;select&gt; to initially display as blank in the collapsed state, and will submit the author-supplied default value as the value of the control if the user does not make a proper selection.<br>


<br>
This sound good?<br>
</blockquote>
<br></div>
Almost! &nbsp;The only problem is, I might want the text of my &quot;blank&quot; option to be something other than whitespace, for example &quot;(none)&quot;, &quot;None of the above&quot; (it could be the last option instead of the first), etc. &nbsp;Remember that in a case where the initial state is some other &lt;option&gt; selected, we want the user to be able to choose the &quot;blank&quot; option, and &quot;(none)&quot; is much clearer in the expanded menu than whitespace, which may not be recognized as being a selectable choice.</blockquote>

</div></div><div><br>Well, remember what the fallback &lt;option&gt; is for.&nbsp; It&#39;s *only* meant to indicate that the &lt;select&gt; has *not* been selected yet.&nbsp; If &quot;None of the Above&quot; or whatever is a valid choice, then it is ipso facto *not* a fallback option.&nbsp; It may be the default option, but that&#39;s no different than a country selector setting United States as the default.&nbsp; This doesn&#39;t clash with my proposal at all, as it doesn&#39;t run afoul of the &quot;first child of the &lt;select&gt; with whitespace for content&quot; rule.&nbsp; The &quot;none of the above&quot; option can be first, last, or anything in between.<br>

<br>You can even specify both a fallback and a &quot;none of the above&quot; option with the same value if you so chose, though how that would be different from just setting the &quot;none of the above&quot; option as @selected, I don&#39;t know.<br>

<br>So, frex, this code would be perfectly fine, and would display the same in both legacy and hypothetical conforming UAs:<br>&lt;select&gt;<br>&nbsp; &lt;option value=&quot;&quot;&gt;None of these&lt;/option&gt;<br>&nbsp; &lt;option value=&quot;love it&quot;&gt;Love It&lt;/option&gt;<br>

&nbsp; &lt;option value=&quot;hate it&quot;&gt;Hate It&lt;/option&gt;<br>&lt;/select&gt;<br>Because there&#39;s no @hint attribute, both legacy and conformant UAs would show the &quot;None of these&quot; option by default, and submit its value (the empty string) if the user doesn&#39;t actively select anything.<br>

<br>If you provide a @hint attribute, the *only* change will be that conformant UAs will display the hint in the collapsed &lt;select&gt; until the user actively selects something.&nbsp; Both legacy and conformant UAs will submit the empty string as the value of the control if the user doesn&#39;t actively select anything, because that is the value of the first &lt;option&gt;.&nbsp; The defining point of this piece of code is that &quot;None of these&quot; is an acceptable default option to the author.&nbsp; (Note that the author should probably give the first option @selected, but that would prevent the hint from displaying; there are some tradeoffs here.&nbsp; Without the @selected it works the same, though.)<br>

<br>On the other hand, this markup works differently:<br>&lt;select hint=&quot;Select one&quot;&gt;<br>
&nbsp; &lt;option value=&quot;[[invalid]]&quot;&gt;&lt;/option&gt;<br>&nbsp; &lt;option value=&quot;&quot;&gt;None of these&lt;/option&gt;<br>
&nbsp; &lt;option value=&quot;love it&quot;&gt;Love It&lt;/option&gt;<br>
&nbsp; &lt;option value=&quot;hate it&quot;&gt;Hate It&lt;/option&gt;<br>
&lt;/select&gt;<br>In a conformant UA, the &lt;select&gt; will initially display &quot;Select one&quot; while it is collapsed.&nbsp; When it is expanded, the first (blank) option will *not* display.&nbsp; If the user attempts to submit the form without actively selecting a value, the UA will prevent it and inform them that they must select a value in the control.<br>

<br>In a legacy UA, on the other hand, the &lt;select&gt; will initially display empty when collapsed, and will have a blank line as the first option when expanded.&nbsp; If the user submits the form without actively selecting a value, the server will receive the value &quot;[[invalid]]&quot;, which lets the author know that the user didn&#39;t actively select an option (or chose to select the blank &lt;option&gt;, which is just as invalid), and that the user should be returned to the form with an error message.<br>

<br>And, of course, contrast that with this markup, which is how you would do this currently:<br>&lt;select&gt;<br>

&nbsp; &lt;option value=&quot;[[invalid]]&quot;&gt;Select one&lt;/option&gt;<br>
&nbsp; &lt;option value=&quot;&quot;&gt;None of these&lt;/option&gt;<br>

&nbsp; &lt;option value=&quot;love it&quot;&gt;Love It&lt;/option&gt;<br>

&nbsp; &lt;option value=&quot;hate it&quot;&gt;Hate It&lt;/option&gt;<br>

&lt;/select&gt;<br>The UA will display &quot;Select one&quot; initially in the &lt;select&gt;, and will send &quot;[[invalid]]&quot; if the user doesn&#39;t select anything.&nbsp; The difference is that there&#39;s no way for a UA to detect that the form shouldn&#39;t be submitted with the first &lt;option&gt; selected, and so any client-side validation has to be done explicitly with scripting.<br>

<br></div><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Reserving value=&quot;&quot; to indicate which option is the &quot;blank&quot; one would solve this problem (while presenting more). :-)<font color="#888888"><br>

</font></blockquote></div></div><br>Yeah, I don&#39;t think there&#39;s any need to go this far.&nbsp; The existing hinting practices allow us to formulate more exacting requirements for recognizing a non-option, which avoids us having to deprecate large swaths of behavior.<br>
<font color="#888888">
<br>~TJ<br>
</font></blockquote></div><br>