I have an jQuery.autocomplete field presenting a limited range of decimal numbers. Ex:
var the_list = ['+2.23', '+1.10', '-1.10', '-2.00', '-3.00',]
But I allow the user to enter data like '2.3' and '-5'. At least I can get partial matches to help me when i start typing for these values.
But what if I (or someone else with clumsy fingers) enter '2,3' (with a comma instead of a decimal point). As soon as I hit the comma I will get no matches. Can this be fixed in some way?
My thought was to create a handler on keydown-event witch replaces the comma with a decimal point before the autocomplet-handler gets started. I have tried to add an eventhandler to the field, but then the autocompleter stops working all together, and there seems to be no way to specify the order of execution of the handlers either.
Please inform me how this could be done, if at all possible. Any suggestions welcome.