Is it a number???

Results 1 to 2 of 2

Thread: Is it a number???

  1. #1
    Join Date
    Dec 1969

    Default Is it a number???

    Hi all... <BR><BR>I would like to know how i can tell whether the user entered a number or a word in the textbox for validation purposes.<BR><BR>I would like to do this before the form is submitted. How can i read this in Javascript or vbscript?<BR><BR>Maybe something similar to this<BR><BR>if isNumber(form1.thevalue.value) <BR>alert("its a number")<BR>else<BR>alert it aint a number..<BR><BR>That was just a guess.. what is the correct way..?<BR><BR>Cheers<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default isNaN()

    Or something like that.<BR><BR>Alternatively, you could write a routine that looks at each character and verifies that it is a number -- keep negative values in mind.<BR><BR>-Doug

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts