I hope this hasn't been answered somewhere :)
I am using the follwing form input field to allow customers to update the quantity of items in their basket:
<input type="text" name="item_qty[<?php echo $product['product_id']; ?>]" value="<?php echo $product['product_qty']; ?>">
So each item in the basket has an input field as above and there is one submit button to update all product quantities in one go.
My problem is that I cannot work out how to create the required array in jquery to send through ajax using the array in the name element (I want to keep it like this if possible as I want to ensure that the form will work as a normal submit to the PHP file if there is any reason why the jquery can't be initialised).
I have thought that maybe the name should be the key from the basket array but not sure. Can anyone advise of the best way to do this and if it is to keep the input field as it is now, how I get the required data to create an array in jquery please.
$('form').serialize();
– u_mulder Jun 20 at 7:57