|
-
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
-
Oct 30th, 2002, 04:20 PM
#2
Addicted Member
If not IsNumeric(text1.text) then msgbox "Entry must be numeric"
.·*¨) ¸.·*¨) ¸.·*¨*
(¸.*´ ¸.·´*'~*Renee~* (¸.*´~*
Funny how the little things can stop you dead in your tracks. 
-
Oct 30th, 2002, 05:29 PM
#3
Thread Starter
Lively Member
Thank you! Wow was that easy.
I don't know why I couldn't find something so simple in my texts...
Ah well.
Thanks,
Ed
-
Oct 30th, 2002, 05:32 PM
#4
Addicted Member
.·*¨) ¸.·*¨) ¸.·*¨*
(¸.*´ ¸.·´*'~*Renee~* (¸.*´~*
Funny how the little things can stop you dead in your tracks. 
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
|