[whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

Markus Ernst derernst at gmx.ch
Tue Mar 8 10:46:41 PST 2011


Am 08.03.2011 19:02 schrieb Anne van Kesteren:
> On Tue, 08 Mar 2011 12:26:56 +0100, Jukka K. Korpela
> <jkorpela at cs.tut.fi> wrote:
>> For example, consider a date picker. Quite often, whether trying to
>> make dates or selling flights, there is a known set of
>> (non-consecutive) days that are possible, so we would like to write, say,
>>
>> <input type="date" id="date" name="date"
>> value="2011-04-01" list="datelist">
>> <datalist id="datelist">
>> <option value="2011-04-01" label="April 1st">
>> <option value="2011-04-08" label="April 8th">
>> <option value="2011-04-09" label="April 9th">
>> </datalist>
>>
>> This is currently conforming, though no browser seems to make use of
>> the datalist. A good implementation would open up a calendar for
>> April, with only days 1, 8, 9 selectable and day 1 highlighted. Many
>> existing applications use such interfaces, so there is apparent need
>> for them.
>
> Agreed that we should fix this, but note that <datalist> is for
> additional or pre-suggested options. The idea is that the user still has
> choice so the other days should be selectable too.

Which means in the mentioned use case, that the user can select a date 
when no flight is actually available. We can of course validate the 
input and ask the user to select another date, but still this results in 
sub-optimal user experience (and extra JS code).

The "exclusive" attribute suggested by Jukka K. Korpela for the datalist 
element would change this behaviour, making unavailable options 
unselectable.

I hope very much that this proposal will make it into the standard. 
Except for date/time and color input elements, I can also imagine use 
cases regarding the range element (if a part of the range is not available).


More information about the whatwg mailing list