List Box with dynamic submit button

What I am trying to do is add a list box to my site that when the user clicks on a certain item and presses submit the correct code gets sent to my cgi cart.

any ideas on how i can accomplish this?


nevermind i got it. thank you for the help.

OK. so what I have is a list box or drop down menu.

This is for a single product with multiple quantities. Once a quantity is selected and they hit submit, I am trying to get that variable to my cart.

I am having trouble figuring out how to add in all of my item numbers and send them to the cart successfully, upon selection.


I wish I knew what you meant by “list box”. Do you mean a <select> element?

This made the most sense to me, in which case, those belong in forms and the form should submit, as they are want to do.

As someone who shops with Javascript disabled, this is preferable anyway. You can always use Javascript to remove other form elements to clean up the form a bit for those who have JS enabled.

You can also have JS add “submit buttons” which, when clicked, use AJAX to ask the server to update that little section of the cart, and let users who have no JS just fill everything in at once and hit the real submit at the bottom. Those users would just get a whole page refresh like normal.

Could you be more descriptive?