On Thu, Oct 23, 2008 at 12:45 PM, Andy Lyttle <span dir="ltr"><<a href="mailto:whatwg@phroggy.com">whatwg@phroggy.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Oct 23, 2008, at 5:31 AM, Ian Hickson 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;">
This use case is definitely something we want to consider, but I don't<br>
think it's about required="". It's about an option in the <select> being a<br>
non-option (as it were). <select> by definition can't have nothing<br>
selected. That's what it means.<br>
<br>
The issue about a placeholder value is listed as an open issue in the<br>
spec, and will probably be addressed at some future point.<br>
</blockquote>
<br></div>
This is an interesting point I hadn't considered. It's *very* common to use the first <option> in a <select> as a non-choice such as "Choose one...", setting the value to something unique (often "" but it could be something else if "" is a valid choice) so it can be treated as a non-selection. This serves *precisely* the same purpose as the placeholder attribute on text input fields, which I had assumed wouldn't be valid for <select>.<br>
<br>
I suggest that the placeholder attribute should indeed apply to <select>, and the behavior should be similar to the current practice of using the first <option>. In particular, the placeholder should appear both on the collapsed menu, and at the top of the open menu, although it should not be selectable.<br>
<br>
But the question is, when the menu is collapsed, when should the placeholder be displayed instead of one of the options? Any time the value is ""? Only until the user selects something? Somebody smarter than me, please figure this out. :-)<font color="#888888"></font></blockquote>
<div><br>Very nice; I like the idea of expanding the proposed placeholder/hint attribute, and this does indeed seem perfect for it.<br><br>Ultimately the display of the hint is, and should be, up to the UA, so that non-full-featured devices can display things in a maximally helpful way to the user. Within the context of a standard browser on an ordinary computer, though, the correct display seems relatively clear. When the select is collapsed, the hint should show until the user selects something. After the user selects something, the hint will never again display in the collapsed state. I'm not sure if it's necessary for the hint to display in the expanded state. If it is, though, then it should always be the first item in the list, and it should be nonselectable, similar to how column groups display currently.<br>
<br>~TJ<br></div></div>