I have this form:
...
<td><input type="text" name="code[]" value="" /></td>
<td>
<select class="selectProductOrders" name="selectProductOrders[]">
<option value="default" disabled selected>Select a product</option>
</select>
</td>
<td><input type="number" pattern="[0-9]*" name="rsp[]" value="" /></td>
<td><input type="number" pattern="[0-9]*" name="trade[]" value="" /></td>
<td><input type="number" pattern="[0-9]*" name="discount[]" value="0" /></td>
<td><input type="number" pattern="[0-9]*" name="qty[]" value="" /></td>
<td><input type="number" pattern="[0-9]*" name="cost[]" value="" /></td>
...
There is more above and below it but this is the important part. This row in a table is repeated depending on how many products are in the order, so I thought it would be easier to parse arrays of each order item element on the server side. And because the form is quite large I have decided to use jQuery.serialize()
to send the data in json format.
It sends the rest of the form ok, but doesnt send over arrays of each input element stated above, it just sends the last row.
Any idea of a solution to this? I suppose I could just type the values out form the form manually into a json format but I wanted to get my head round the serialize problem.
Thanks!