I'm having issues with trying to calculate the total value of a dynamic number of text boxes. I've tried using:
but I get an error saying type mismatch in refrence to the qty += line...
dim qty, bCart
bCart = Split(Session("CartContents"),"|")
qty = 0
dim ship, subtot, gtot
For i = 0 to UBound(bCart)
qty += cint(document.Order.Quantity(<%'i%>).Value)
ship = 4.99*(fix(qty/2)+1)
'subtot = //dunno how to pull a single peice of info from a huge string, need help here as well...
tgtot = ship+subtot
Knowing the total quantity is dire to calculating shipping. How do I manage to cycle through the textboxes created by this code:
and successfully get a total so that I can calculate shipping?
Dim aCart, i, aItems, x, itemcnt
itemcnt = 0
aCart = Split(Session("CartContents"),"|")
For i = 0 to UBound(aCart)
aItems = Split(aCart(i),"-")
For x = 0 to UBound(aItems)
Response.Write "<td>" & aItems(x) & "</td>"
<td><input name="Quantity<%=i%>" type="text" size="8" value="1" /></td>