troubleshooting Question

Update Quantity Script

Avatar of garethtnash
garethtnashFlag for United Kingdom of Great Britain and Northern Ireland asked on
ASPScripting LanguagesVB Script
2 Comments1 Solution377 ViewsLast Modified:
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%>

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" />

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
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros