<< Back to AndrewPeace.com

Javascript is_numeric() demo

Updated Tuesday, June 10, 2008

This page is a demo of the is_numeric() function. It works for all inputs, in all browsers. Tested in FireFox 2.0 and Internet Explorer 7. Compatible in IE5 and IE6.

Value is_numeric()
5
4.567
10-5
"cat"
"another string"
false

Javascript form_input_is_numeric() demo

Use this function to validate form input. If you put a number in the text box, it will recognize it. If you tried to do this using the regular is_numeric() function, it wouldn't work.

Input text:

Valid XHTML 1.0 Strict

Valid CSS!

Banner Exchange