i got a textbox, how can i determine what user input in
my situation is
firstly textbox would display $0.00
user my input 4.00 or 4 or $4 or $4.00
anyway , i just wanna display $4.00 after user mouse leave this textbox
how can i achive? ... i duno how to use typeof() to check
syntax?
if you want this to happen when the user leaves the textbox then you will have to use javascript and the .blur() event...
Otherwise you will have to turn on AutoPostBack on the textbox, check the value in the code and adjust it.
You could use a validation control for this as well. A RegularExpression validation might work for you, or a custom validation. Validation will force the user to provide valid input, not change the input they enter into a different format. It can help solve issues like when a user enters "40" and you don't know whether it's 40 dollars or 40 cents.
Jeff
No comments:
Post a Comment