Link to home
Start Free TrialLog in
Avatar of garethtnash
garethtnashFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Update Quantity Script

Hi Experts,

I have a VBScript that checks values in a form and if the values meet one of two criteria, runs one of two SQL stored Procedures -

The basic syntax is -

<%IF Request("newquantity") < Request("MaxOrder") then
If Request("newquantity") <> 0 Then
'Do Something and then Redirect
Response.Redirect ("/mytgi/direct/editorder.asp?i=" & (RSOrderItem.Fields.Item("OrderID").Value) & "")
Else
'Do something Else and then redirect
Response.Redirect ("/mytgi/direct/editorder.asp?i=" & (RSOrderItem.Fields.Item("ID").Value) & "")

End If
End if%>

Open in new window


the really confusing thing here is ; so my script starts -

<%IF (Request("newquantity")) < (Request("MaxOrder")) then...

So as long (Request("newquantity")) is less than (Request("MaxOrder")) the script runs, right?

my inputs are -

<input name="newquantity" type="text" class="quantitybox" id="newquantity" value="4" maxlength="4" />
<input name="MaxOrder" type="hidden" id="MaxOrder" value="259" />
<input name="ProductID" type="hidden" id="ProductID" value="61" />
<input name="OrderLineID" type="hidden" id="OrderLineID" value="726" />
<input name="Quantity" type="hidden" id="Quantity" value="1" />

Open in new window


4 is less than 259 right? so the script should run....

it doesnt, it works if I change the quantity from 1 to 2
or from 2 to 1
try changing the figure to 3 or 4 or 5, 6,7,8, or 9 - the page just refreshes
10 is fine the script runs through to 22 all fine
100 is fine
99 - nothing - in fact - 33, 44, 55, 66, 77, 88 - all nothing, the page just refreshes ans reverts to the original value...

I'm majorly confused - please advise..

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of garethtnash

ASKER

Thank you