By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,384 Members | 1,847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,384 IT Pros & Developers. It's quick & easy.

restricting textbox input

P: 1
hello,

is there a way to restricting a textbox input wherein it will only accept two integer with decimal places? for example if i enter 90 or 90.1234 it will allow me and when i try to type 890 or 890.7832 it will not accept it.

any help will be greatly appreciated. :)
Sep 20 '06 #1
Share this Question
Share on Google+
2 Replies


10K+
P: 13,264
hello,

is there a way to restricting a textbox input wherein it will only accept two integer with decimal places? for example if i enter 90 or 90.1234 it will allow me and when i try to type 890 or 890.7832 it will not accept it.

any help will be greatly appreciated. :)
I think you need to use a regular expression.
Form a pattern and validate the input against that pattern
Sep 20 '06 #2

P: 8
Here's an introductory tutorial:
http://javascriptkit.com/javatutors/re.shtml

and another at the same site:
http://javascriptkit.com/javatutors/redev.shtml

but I think the best source is:
http://www.regular-expressions.info/index.html
Sep 20 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.