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

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

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 4 Sep 2009 20:52:40 +0000 (UTC)
To: Ric Hardacre <ricster@cyclomedia.co.uk>
Cc: public-html-comments@w3.org
Message-ID: <Pine.LNX.4.62.0909042052090.6775@hixie.dreamhostps.com>
On Wed, 2 Sep 2009, Ric Hardacre wrote:
>
> 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
> example!):
> 
> <input type="text" id="fruit" onkeyup="fruit_list(this)" >
> <script>
> function fruit_list( elem )
> {
>   elem.list = "http://example.com/fragments/fruit-suggestions.php?value="
> + elem.value;
> }
> </script>
> 
> 
> 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:
> 
> "<option>Apples</option><option>Bananas</option><option>Oranges</option>"
> 
> 
> 
> 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>
> <script>
>   function select_make( elem )
>   {
>     document.getElementById("model").options =
> "http://example.com/fragments/models.php?make=" + elem.value;
>   }
> </script>

We actually had something like this earlier in the spec's lifetime, but we 
removed it because it has a number of difficult problems to deal with and 
was not compelling enough to justify.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 4 September 2009 20:56:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:14:00 GMT