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

Allow list attribute to contain a URI pointing to an innerHTML-like fragment

From: Ric Hardacre <ricster@cyclomedia.co.uk>
Date: Wed, 2 Sep 2009 12:50:42 +0100 (BST)
Message-ID: <1180.>
To: public-html-comments@w3.org
Allow the ability to directly embed or set via javascript a URI that when
polled with a HTTP GET request will return the HTML fragment that would
make up the list of OPTION elements as if it were a physical DATALIST that
had its contents set via innerHTML.

<input type="text" id="fruit"
list="http://example.com/fragments/fruit-suggestions.htm" >

This could be a full GET including a search string, allowing search engine
style suggest-as-you-type (performance considerations aside for this

<input type="text" id="fruit" onkeyup="fruit_list(this)" >
function fruit_list( elem )
  elem.list = "http://example.com/fragments/fruit-suggestions.php?value="
+ elem.value;

Standard GET rules would apply, specifically allowing the returned
fragment to be cached locally.

The fragment returned by the server would look like the following:


This could feasibly be used to solve the long standing SELECT that fills
another SELECT dilemma

<select id="make" onchange="select_make(this)">...</select>
<select id="model">...</select>
  function select_make( elem )
    document.getElementById("model").options =
"http://example.com/fragments/models.php?make=" + elem.value;

Ric Hardacre
Received on Wednesday, 2 September 2009 14:11:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:25 UTC