Number field

Results 1 to 2 of 2

Thread: Number field

  1. #1
    Join Date
    Dec 1969

    Default Number field

    Hi,<BR>Is there a way to test number field. I mean, i would like to test whether the input is only numeric.<BR>I have tested the blank and length by follwoing.<BR><BR>function validate()<BR>{<BR>x=document.frmreg<BR>id=x.txtst udentid.value<BR>if (id.length&#060;1)<BR> {<BR> alert("Please enter your Student ID")<BR> return false<BR> }<BR> <BR> id=x.txtstudentid.value<BR>if (id.length&#062;8)<BR> {<BR> alert("Wrong ID!")<BR> return false<BR> }<BR> <BR>else // fields populated<BR> {<BR> return true<BR> }<BR>}

  2. #2
    Join Date
    Dec 1969

    Default RE: Number field

    Use IsNumeric function that returns a Boolean value that indicates whether a specified expression can be evaluated as a number.<BR><BR>

Posting Permissions

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