I have a small form with three fields and I can submit that form choose different options next time. I am submitting this form with ajax call.
Now on form submit I want to post all the selected options. For this, I have created a hidden field like
<input type="hidden" name="selectedproduct[]" id="sel-product">
and ajax success method am appending value like
$('#sel-product').val(element.product);
But here I am getting only one value instead of an array. How can I append all the values to the field?