I'm trying to process a form via ajax request. The problem is that I have an array variable inside the form and when I process it via serialize to be send via ajax it returns this:
email_id%5B%5D=1&email_id%5B%5D=2&test=23
That is the result of .serialize.
I am also using multiple select tags for the array variable.
Why am I getting this error and what should I do to avoid and fix it.
<select name="email_id[]" id="email_id_0" style="width: 350px;margin-right: 5;">
</select>
function setList(str){
var postDatas = $('#form'+str+'').serialize();
alert(postDatas);
// $('#crm-feedback').html('<img src="images/ajax-loader.gif"/>');
$.ajax({
url: 'somewhere/file.php',
type: 'POST',
data: postDatas,
success: function(data){
// $('#crm-feedback').html('Saved!').css('color','green');
alert("test");
}
});
}
Thank you.