<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.26.3">
</HEAD>
<BODY>
On Mon, 2010-08-09 at 16:54 -0700, Jonas Sicking wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On Mon, Aug 9, 2010 at 4:35 PM, Ian Hickson <<A HREF="mailto:ian@hixie.ch">ian@hixie.ch</A>> wrote:
> On Fri, 18 Jun 2010, Mounir Lamouri wrote:
>>
>> I'm wondering why select element do not have a required attribute.
>
> It's impossible to submit a <select> element (without a size="" attribute
> or multiple="" attribute) without it having a value -- essentially,
> required="" is already implied.
>
>
> On Thu, 22 Jul 2010, Mounir Lamouri wrote:
>>
>> 1. A typical use case of <select> is to have <option value=''>Choose an
>> option</option> as a default value. Having @required would prevent
>> authors to write any js check when they are using <select> like that.
>
> That seems like an invalid use of <option> to me. It would be better as:
>
> <label> Choose an option: <select> ... </select> </label>
Many times you want the user to make an explicit choice, rather than
just leaving whatever was already selected. What many websites do is:
<label>Choose an option:
<select>
<option></option>
<option>value 1</option>
<option>value 2</option>
<option>value 3</option>
</select>
</label>
Or
<select>
<option value="">Choose an option:</option>
<option>value 1</option>
<option>value 2</option>
<option>value 3</option>
</select>
It would be good if it was possible to use @required together with
these usage patterns. I don't believe that any other feature of HTML
supplies the same, or similar, functionality? While authors could do
<label>Choose an option:
<select>
<option>value 1</option>
<option>value 2</option>
<option>value 3</option>
</select>
</label>
I think there is a reason they haven't done so so far, and I don't see
that HTML5 changes any of those reasons.
While I guess we could wait for v2 for this feature, it seems like a
glaring omission and inconsistency in the way that @required works.
/ Jonas
</PRE>
</BLOCKQUOTE>
<BR>
This is wrong in my opinion, it just doesn't make sense to have loads of empty elements. Select lists get used for a lot of wrong things sometimes, such as a year picker (of which there are many tales on the daily wtf where the data range just isn't well thought out)<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
Thanks,<BR>
Ash<BR>
<A HREF="http://www.ashleysheridan.co.uk">http://www.ashleysheridan.co.uk</A><BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>