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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking Field To Make Sure User Entered A Number 1

Status
Not open for further replies.

FontanaS

Programmer
May 1, 2001
357
US
Hi!

I have a quantity field where the user types in how many they purchased of an item.

Well someone yesterday actually wrote - "Five" and not "5".
So now I need to check to make sure it is a number.

Is there a function that allows this?
THANKS!

The field is -
IF ISNULL(Request.Form("SubOrderUnitPrice1")) OR ISEMPTY(Request.Form("SubOrderUnitPrice1")) OR Request.Form("SubOrderUnitPrice1")="" THEN
lvUnitPrice1 = 0
ELSE
***NEED TO CHECK HERE TO MAKE SURE IT IS A NUMBER***
lvUnitPrice1 = Request.Form("SubOrderUnitPrice1")
END IF
 
the function you are looking for is ISNUMERIC()


Code:
if ISNUMERIC(request("SubOrderUnitPrice1") = false then

response.write("You must enter a number in the qty field")

end if

CHeers

QatQat

Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top