Posted on 2004-10-13
I have an asp.net textbox and need the input to only allow numeric values and a decimal. I need the text to automatically format to 000.00. For example if the user only types "3"...The text should format to 003.00. If they type 1.5 it should show 001.50 and so on. Also, the JS should not automatically enter a value...meaning if they enter the field (which by default will not be masked as it is not required), type something, delete it and leave, I want the textbox to still display nothing (empty string).
I'd prefer this happen onKeyUp rather than onBlur so that the users are not experiencing surprise formatting.