W3C home > Mailing lists > Public > public-html@w3.org > September 2007

Re: Use cases for a few elements: datalist

From: Jon Barnett <jonbarnett@gmail.com>
Date: Thu, 6 Sep 2007 17:00:12 -0500
Message-ID: <bde87dd20709061500j301b529bk5cc2fd4d6262cc69@mail.gmail.com>
To: "Robert Burns" <rob@robburns.com>
Cc: "Lachlan Hunt" <lachlan.hunt@lachy.id.au>, public-html <public-html@w3.org>

On 9/6/07, Robert Burns <rob@robburns.com> wrote:

>
> For example, the 'select' element could have a boolean attribute
> added for allow 'other'. Setting the boolean could allow users to
> select an "other....' menu item and be provided with a modal dialog
> to enter other. Such a boolean would address some of the use cases
> you mention. To address the other use cases, we could liaison with
> the CSS WG to add *select* specific properties for presentation. A
> 'select' element might be presented as a combolist or as an editable
> browser/list view. or as a pop-up menu with the before mentioned
> 'other...' menu item.

The way datalist is defined, it degrades more gracefully than what you describe.

>From the draft:
 <label>
  Enter a breed:
  <input type="text" name="breed" list="breeds">
  <datalist id="breeds">
   <option value="Abyssinian">
   <option value="Alpaca">
   <!-- ... -->
  </datalist>
 </label>

That could be presented as a combo-box, a text input combined with a
drop-down list of presdefined options.

It would gracefully degrade to a regular text input (with no dropdown list)

Also from the draft (the same thing with more graceful degredation):
 <label>
  Enter a breed:
  <input type="text" name="breed" list="breeds">
 </label>
 <datalist id="breeds">
  <label>
   or select one from the list:
   <select name="breed">
    <option value=""> (none selected)
    <option>Abyssinian
    <option>Alpaca
    <!-- ... -->
   </select>
  </label>
 </datalist>

That could also be presented as a combobox (though nothing precludes a
UA from using any presentation method you described)

That would gracefully degrade to a regular text input followed by a
regular <select> element.

The alternative you mentioned - overloading <select> instead of using
<datalist> - can only gracefully degrade to a regular select element,
as far as I can tell.

-- 
Jon Barnett
Received on Thursday, 6 September 2007 22:00:17 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:49 UTC