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

Shopping cart problem

Status
Not open for further replies.

xscape

Programmer
Apr 18, 2001
144
GB
Hi,

I'm developing a shopping cart system and it's all working fine except one bit I'm stuck on...
When you've added something to your cart it displays the details and quantity. The quantity is displayed in a textbox so you can change it and hit the update button so the form posts the new quantity to cart.

I've seen other shopping carts out there where they have one update button and you change the quatities in the fields and hit the button at the bottom - this would be good for me as I'm a bit short on space for a button next to each item.
But how do I identify the fields? I took a look at some HTML used by a cart that uses this method and noticed the form looks a bit like this:
<form ...>
<input type=&quot;hidden&quot; name=&quot;itemID&quot; value=&quot;212&quot;>
<input type=&quot;text&quot; name=&quot;quantity&quot; value=&quot;1&quot;>

<input type=&quot;hidden&quot; name=&quot;itemID&quot; value=&quot;128&quot;>
<input type=&quot;text&quot; name=&quot;quantity&quot; value=&quot;2&quot;>
...
</form>
Any ideas on how I could get my ASP page to split these up so I can read the first pair, then the second? Any help would be great!! Thanks!
 
Ahh, solved it! Just used &quot;quantity&quot; + the item id to identify each field and used a for loop to loop through 'em. Got there in the end anyways.... ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top