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

How to update the product quantity in ASP shopping cart

Status
Not open for further replies.

dmcabs

Technical User
Apr 28, 2003
18
0
0
AU
Hello,

I got some questions when I update the quantity of products in my shopping cart by using ASP. Is there anyone get some ideas about it?

In that FOR Each ...........Next, How could you get the value from the Form one product by one product? How did you set hidden input box (name and ID) in the page?

Thank you.
--------------------
With quantity input text box for each item. But I cannot get the value from the textbox after I change the quantity.
Product Qty
Item 1 1
Item 2 1
Item 3 1
[Update Cart] Does anyone have any tutorials or advice on how to do this? ASP with Access.

Function UpdateItem()
MyCart = Session("Cart")
i=0
For Each txtQty in Request.Form
if MyCart(i,0)<>"" then
MyCart(i,1)=trim(request.Form(txtQty))
i=i+1
end if
Next
Session("cart")=MyCart
End Function

MCP(2k), A+ Tech
 
Can you give us some more details about how your shopping cart system is coded. They are all a little different so it can be dangerous to make assuptions.

From the small code that you did post I assume that your cart is a two dimensional array stored in a session variable...
 
Thank you very much for your helps. My question is that the view page of my shopping cart does not send updated quantity of products to the processing page. I think it is related to the form in the view page of shopping cart. I just used text links as updated button in the form.

I think this problem could be fixed possiblely if I change the updated button to image or button. I will try to do that and let you know the result.

Thanks

MCP(2k), A+ Tech
 
You cannot send form data from one page to another without doing a Submit. If you just use a link to load the next page that page does not have the ability to read the form values from the previous page.
You have to execute a submit event from the form page whether through code or through a Submit button.


Paranoid? ME?? WHO WANTS TO KNOW????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top