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

[whatwg] [wf2] Filtering datalist with pattern

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 24 Aug 2006 05:50:15 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0608240543170.10139@dhalsim.dreamhost.com>
On Thu, 24 Aug 2006, Matthew Raymond wrote:
> Yeah, I suppose that would be fine, except for extremely rare cases 
> where the value absolutely has to be outside the pattern. The following 
> don't have fixed-length numeric values, for instance:
> | <datalist id="math">
> |   <option label="i" value="sqrt(-1)">
> |   <option label="&pi;" value="pi">
> |   <option label="e" value="e">
> | </datalist>
> I'm not entirely sure if they're a big enough deal to bother with.

You could deal with pi and e easily enough even then, just by rounding the 
given value and then looking for that particular value as a magic number 
in the submission handling and then treating them as pi/e. It's a hack, 
but it works.

That doesn't handle i, but I have yet to see a form that asks me to select 
a number and gives specific imaginary numbers as an option (as opposed 
to accepting any complex number, at which point there's no problem again).

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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:48 UTC