[whatwg] [wf2] Filtering datalist with pattern

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