[whatwg] Why children of datalist elements are barred from constraint validation?

Jonas Sicking jonas at sicking.cc
Fri Jul 29 14:51:44 PDT 2011


On Fri, Jul 29, 2011 at 9:43 AM, Ian Hickson <ian at hixie.ch> wrote:
> On Fri, 29 Jul 2011, Jonas Sicking wrote:
>> On Thu, Jul 28, 2011 at 6:07 PM, Ian Hickson <ian at hixie.ch> wrote:
>> > On Mon, 2 May 2011, Jonas Sicking wrote:
>> >> On Mon, May 2, 2011 at 3:36 PM, Ian Hickson <ian at hixie.ch> wrote:
>> >> >
>> >> > <select> in a <datalist> is completely ignored for form submission. In
>> >> > fact, any form element at all in <datalist> is ignored for form
>> >> > submission. See the "construct the form data set" algorithm:
>> >> >
>> >> > http://www.whatwg.org/specs/web-apps/current-work/complete.html#constructing-the-form-data-set
>> >> >
>> >> > It's so that you can do things like:
>> >> >
>> >> >   <input ... list=options>
>> >> >   <datalist id=options>
>> >> >     <select ...>
>> >> >       <option>...</option>
>> >> >     </select>
>> >> >     ...maybe other form controls here...
>> >> >   </datalist>
>> >> >
>> >> > Basically everything in the <datalist> except the <option> elements is
>> >> > for fallback in legacy UAs and is ignored in new UAs.
>> >>
>> >> Couldn't this be accomplished using a few lines of javascript?
>> >
>> > Not when scripts are disabled, no.
>>
>> The number of cases when a site can use this solution to get an
>> acceptable UI *and* care about supporting users with scripts disabled
>> *and* is planning to roll out support within the timeframe when there's
>> some support for HTML5 forms, but not enough to rely on it, is extremely
>> small.
>
> That's possible. The entire Web Forms 2 feature set is designed with this
> kind of fallback in mind, though.
>
>
>> My experience is that it's much more likely that people will use other
>> solutions until there is wide enough browser support to reliably use it,
>> and then use javascript as a fallback and not care about users with JS
>> disabled. And that goes even if we add this feature or not.
>
> If that's the case, we should probably rethink the entire design of the
> WF2 features, because maybe there's better ways to do things.

I'd be very interested to hear how we would have designed things
differently under those constraints.

> Looking specifically at <datagrid>'s ability to fall back to <select>, I
> agree that it's not necessarily doing to be widely used, but given that
> it's so simple to support and provides such a clean way to do fallback, I
> really don't see the harm in supporting it.

I haven't looked at <datagrid> yet, so I can't comment.

/ Jonas



More information about the whatwg mailing list