Results 1 to 4 of 4

Thread: Integer/Text Form Validation...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    88

    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

  2. #2
    Addicted Member Renee K's Avatar
    Join Date
    Jun 2002
    Posts
    163
    If not IsNumeric(text1.text) then msgbox "Entry must be numeric"
    .·*¨) ¸.·*¨) ¸.·*¨*
    (¸.*´ ¸.·´*'~*Renee~* (¸.*´~*



    Funny how the little things can stop you dead in your tracks.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    88
    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

  4. #4
    Addicted Member Renee K's Avatar
    Join Date
    Jun 2002
    Posts
    163
    I'm glad I could help.
    .·*¨) ¸.·*¨) ¸.·*¨*
    (¸.*´ ¸.·´*'~*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
  •  



Click Here to Expand Forum to Full Width