I'm using this plugin --> http://jquery.malsup.com/form/
But I can't post an array to a PHP script.
I tried this in the beforeSubmit function:
var concepts = new Array();
$('#myTable tbody tr td span.file').each(function(){
concepts.push($(this).text());
});
arr.push({name: 'concepts',value:concepts});
And this in the data parameter:
data: {
concepts: function(){
var concepts = new Array();
$('#myTable tbody tr td span.file').each(function(){
concepts.push($(this).text());
});
return concepts;
}
}
But I always receive a comma separated string in the PHP script not an array like in any ajax call.
[concepts] => 20 Bafles J8 DB Line Array, 4 Bafles J12 DB Line Array, 10 Bafles J SUB, 12 Bafles B2 DB, 2 Bummpers J, 4 Bafles Q7 DB Front Fill, 12 Monitores M4 DB, 38 Amplificadores, Sub Snake, 6 Bafles Q1 DB Side Fill, 6 Bafles Q SUB DB, Centro de Carga,Andamio de 4 mts. de altura brandeados por los 4 lados con lona mesh a 1,200 dpis
The above is the result of:
print_r($_POST)
The array has 2 elements in this example.
But my posted data has commas. I know that I can encode to JSON and then decode inside PHP script but, I prefer to send and receive an array. Is there any way to achieve this?
I tried using processData as false, and nothing :(
Thanks in advance!