<< Back to AndrewPeace.com

Javascript is_int() demo

Updated Thursday, June 12, 2008

This page is a demo of the is_int() 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_int()
5
10-5
4.567
"cat"
"another string"
false

Javascript form_input_is_int() demo

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

Input text:

Valid XHTML 1.0 Strict

Valid CSS!