|
-
Oct 30th, 2002, 04:16 PM
#1
Thread Starter
Lively Member
Integer/Text Form Validation...
What's the best way to validate a txtbox that needs an integer input into it so that it does not allow text or other garbage. In JavaScript there's a handy "NaN" ("Not A Number") function that can be validated against a textbox (if x = NaN Then alert("Booom!")) if a string is input instead of an integer.
I've tried converting the textbox to an integer and if the conversion fails, then obviously it's not a number. This is a bit bulky, though, and I'm hoping there's a slicker way.
Those were long sentences. I hope they made sense.
Thanks,
Ed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|