View Single Post
  #4 (permalink)  
Old June 4th, 2003, 03:23 AM
nidgep nidgep is offline
Authorized User
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Andy

Using VBScript you can use the IsNumeric vb function to check for a number.
Dim intNum
intNum = 5

If IsNumeric(intNum) Then
End If


Dim intBasketQty
intBasketQty = Trim(Request.Form("txtBasketQty"))

If IsNumeric(intBasketQty) Then
   ... 'do something here
End If

Hope this helps

quote:Originally posted by aware

Thanx for trying to help.

What I'm doing is this - I have a shopping cart (I've had to write my own rather than use a commercial one to get some specific functionality) The form submits to itself and I pass through the querystring the form values.

I'm validating the form values ie checking that there is a value in various form fields in asp as the page loads.

I'm stuck on how to check that the qty value is a number and not text - I could do this client side with javascript but that would mean I'd have 2 validation routines, one client side and one server. If I have to move all validation client side I could, but if there is a simple solution to check for a number server side it would suit me better.


Andy G