W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2004

[whatwg] Re: several messages

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 30 Jun 2004 23:35:19 +0000 (UTC)
Message-ID: <Pine.LNX.4.58.0406302254370.27872@dhalsim.dreamhost.com>

Wow. Ok, I get the message, you all want editable selects back. :-)

I read all your mails, and here's the compromise I think makes most
sense. It is based directly on suggestions made in these threads, so
if it looks familiar, that's why!

If backwards compatibility is not important:

   <p>
    <label>
     Select a breed:
     <input type="text" name="breed" data="breeds">
     <datalist id="breeds">
      <option value="Abyssinian">
      <option value="Alpaca">
      <!-- ... -->
     </datalist>
    </label>
   </p>


If it is:

   <p>
    <label>
     Select a breed:
     <input type="text" name="breed" data="breeds">
    </label>
    <datalist id="breeds">
     <label>
      or select one from the list:
      <select name="breed">
       <option>Abyssinian
       <option>Alpaca
       <!-- ... -->
      </select>
     </label>
    </datalist>
   </p>


Basically, we add a "data" attribute to <input> elements which applies to
the "text", "uri", "email", "number", "range", and date- and time- related
types. This attribute points to a <datalist> or <select> element (or maybe
any element). The list of values that the UA can show as autocomplete
values consists of all the <option> elements inside the <datalist> or
<select> element (as in, getElementsByTagName('option')). If those
elements have "value" attributes, they are used as the value. Otherwise,
the contents of the <option> elements are used.

All the contents of <datalist> elements are hidden on WF2 UAs, and can
thus be used as the fallback rendering for legacy UAs. Controls inside
<datalist> elements are never successful in WF2 UAs. <datalist> doesn't
take any attributes other than the common attributes.

This doesn't address all the problems I raised earlier. In particular, it
is still possible for legacy UAs to end up submitting two values. It has
advantages though, like you can leverage the data="" attribute on the
<select> element:

   <input type="datetime" data="calendar" name="d">
   <datalist id="calendar">
    <select data="calendar.xml"></select>
   </datalist>

Or maybe we can simply allow data="" on the <datalist>:

   <input type="datetime" data="calendar" name="d">
   <datalist id="calendar" data="calendar.xml"></datalist>

What do people think? Did I miss a critical use case?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 30 June 2004 16:35:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:18 UTC