Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

verififing if entry was a number

Status
Not open for further replies.

tuam1234

Technical User
Feb 6, 2004
52
IE
i would appreciate any help.

in the code below, i am verifying if the user entered in a credit card number in the field.

if (document.formname.cardNum.value == "")

{
// tell client that you need the name
alert("Please enter a valid card number")
// send the cursor to the fullname field
document.formname.cardNum.focus()
// field is empty, so return false to abort the form
// submission
// the client is returned to the form
return false
}


i am trying to get it to check and see if this entry was a number using this statement

(Not(IsNumeric(document.formname.cardNum.value)))

why is it not possible for me to join these 2 conditions together like

if ((document.formname.cardNum.value == "")or Not(IsNumeric(document.formname.cardNum.value))))

any suggestions greatly appreciated!!!
 
Aren't you mixing JScript and VBScript ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
:> thanks, im confused to say the least.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top