Hi,
How can I test that a text field from a form is an integer?
is_numeric is no good, neither is is_int.
Have tried looking for answer... no luck.
Testing a form text field for being an integer
Moderator: General Moderators
-
davesearching
- Forum Newbie
- Posts: 2
- Joined: Thu Jan 15, 2009 11:18 am
Re: Testing a form text field for being an integer
You tryed looking for answer did you? Next time, try google. Ah, the wonders of the internet. (Check out that first result, whoa!)davesearching wrote:Hi,
How can I test that a text field from a form is an integer?
is_numeric is no good, neither is is_int.
Have tried looking for answer... no luck.
Last edited by watson516 on Thu Jan 15, 2009 11:32 am, edited 1 time in total.
Re: Testing a form text field for being an integer
Assuming is_numeric or is_int don't work because you want to test it before the form is submitted?
Then you'll need javascript isInteger():
http://acmesoffware.com/acme/ExamplesJS ... nteger.asp
Then you'll need javascript isInteger():
http://acmesoffware.com/acme/ExamplesJS ... nteger.asp
-
davesearching
- Forum Newbie
- Posts: 2
- Joined: Thu Jan 15, 2009 11:18 am
Re: Testing a form text field for being an integer
Thanks Reviresco and yes watson516 I did use Google and I don't appreciate useless sarcasm.