number feild validation Problem

Results 1 to 2 of 2

Thread: number feild validation Problem

  1. #1
    New to ASP Guest

    Default number feild validation Problem

    I want to validate number field so that whenever user enter text in number field alert message display on screen that "number is require"<BR><BR>How it is possible<BR>Any help will be appreciated

  2. #2
    Join Date
    Dec 1969

    Default RE: number feild validation Problem

    &#060;input type=text name="numberField" onblur="checkIt()"&#062;<BR><BR>here&#039;s the javascript... remember to put it in your &#060;head&#062; tag:<BR>&#060;script language="javascript"&#062;<BR>&#060;!--<BR>function checkNum(){<BR>var data = document.yourFormName.numberField.value;<BR>if (isNaN(data)){<BR>alert("You messed up, try again.");<BR>document.yourFormName.numberField.sel ect(); <BR>document.yourFormName.numberField.focus();}<BR >}<BR>//--&#062;<BR>&#060;/script&#062;<BR><BR>thats it. you may want to check a javascript site for javascript problems. of course, if you do, you&#039;ll find that there is many ways to accomplish this same task, this is only one way.<BR>also, i highly recommend picking up a javascript book, like this one:<BR><BR><BR>justin

Posting Permissions

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