I want to have only a text box with numbers / currency.
So basically, it should accept this type of input
$ 123
523,100
$ 12.50
85.59
and convert it to
123
523100
12.50
85.59
and should not accept this entry
F12
309 $ 2342
, 102
I looked at the validator validation elements, but I would like this conversion / validation entirely from the client side. What would be the best way to do this?
I would also like for a client error (message box or something else) to appear if they try to enter invalid data and prevent them from leaving bad data in the text box. and then when they get out of focus of the text field, it automatically converts the data to a flat number from the client side.
How would I start to do this? Is there anything in ASP.Net that can help me? Do I just need to use the onfocus event, or which event would be preferable from javascript to test this? I am also inexperienced in Javascript .. so I apologize if this is a bit noobish.
And yes, I will also check server side
Earlz source share