469,325 Members | 1,637 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,325 developers. It's quick & easy.

Number Validation

Hi,

I need to check whether the user has entered a numeric value or not in a text box using Javascript. What function can be used for this?

Thanks in advance.

Regards,
Sivakrupa
Apr 9 '09 #1
3 1370
Dormilich
8,651 Expert Mod 8TB
you could use isNaN() or the typeof operator.
Apr 9 '09 #2
That worked out.
Yeah thanks.
Apr 9 '09 #3
acoder
16,027 Expert Mod 8TB
I would recommend regular expressions, e.g.
Expand|Select|Wrap|Line Numbers
  1. /^-?\d*\.?\d+$/
Apr 10 '09 #4

Post your reply

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

Similar topics

2 posts views Thread by Laphan | last post: by
6 posts views Thread by simina | last post: by
3 posts views Thread by tdmailbox | last post: by
6 posts views Thread by JIM.H. | last post: by
2 posts views Thread by Jeff | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.