W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2006

[whatwg] [wf2] Filtering datalist with pattern

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 23 Aug 2006 23:37:38 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0608232319040.10139@dhalsim.dreamhost.com>
On Fri, 26 May 2006, Matthew Raymond wrote:
> Henri Sivonen wrote:
> > The WF2 spec does not say anything about filtering autocomplete lists  
> > on pattern and Opera 9 does not do it. However, autocomplete entries  
> > that would fail form validation are not particularly useful.
> > 
> > I suggest saying that potential autocomplete items (whether supplied  
> > by the UA itself or read from a datalist) should be tested against  
> > the datatype and the pattern of the form field being filled and  
> > should only be shown if they match both the datatype and the pattern.
>    This assumes that the inclusion of such items is unintentional. What
> if you wanted the user to be able to select from a fixed set of values
> that fall outside of the pattern in addition to those that fit the
> pattern? Is the proper way to handle this to force web authors to write
> these values into the pattern? This could be rather troublesome if you
> have a significant set of nonconforming datalist values.

Could you give an example of this? It seems like the common cases, like 
picking named values, would be handled by label="" vs value="":

   1:<input type="number" name="gauge" list="gauges" min="0" step="any">
   <datalist id="gauges">
    <option label="Z" value="220">
    <option label="N" value="160">
    <option label="HO" value="87">
    <option value="8">

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 23 August 2006 16:37:38 UTC

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