I have a hidden field in form A.
<input type="hidden" name="item_name[]" id="item_name" />
I want to add multiple values to this field using jQuery on a button click. this value coming from pop up window that just add these values to hidden field .
var name = $('#formid input[name=name1]').val();
$("#item_name").val(name);
suppose I added values two time "a" and "b" then when I submit the form and print the form values at server side. I get this value
["item_name"]=>
array(1) {
[0]=>
string(2) "ab"
}
how should I proceed to get these value like -
["item_name"]=>
array(2) {
[0]=>
string(1) "a",
[1]=>
string(1) "b"
}