I have a shopping cart that displays a grid of products on a single page. Each product has an input number field to capture the quantity required and an "Add to cart"/ "Update cart" button.
The input number fields each have a class of "product_qty" and an id of "qty_x" and where X is the unique id of the product. The add/update buttons have id "btn_x" and class of "update_cart".
Please can any advise how I can make sure I pass the correct value from the product quantity input to my Ajax form when I click the "Add to cart" button on a particular product.
I sort of need to "link" the input field to the button on each product, in a traditional form, the input and button would be contained within a <form></form>, but I am not sure how to do this in Ajax.