How to pass arrays to sAjaxSource via aoData?
How to pass arrays to sAjaxSource via aoData?
I have a sAjaxSource url that points to a PHP script that accepts a certain parameter as a $_POST array variable(Normally, this would represent checkboxes in a form).
My question is, how do I pass data in aoData in such a way that this will be accepted as an array in the PHP script? I tried this
[code]
aoData.push(
{
'name': 'ids',
'value': [1,2]
});
[/code]
and the PHP script interpreted this as a string( '1,2') as opposed to an array( [1,2] )
My question is, how do I pass data in aoData in such a way that this will be accepted as an array in the PHP script? I tried this
[code]
aoData.push(
{
'name': 'ids',
'value': [1,2]
});
[/code]
and the PHP script interpreted this as a string( '1,2') as opposed to an array( [1,2] )
This discussion has been closed.
Replies
[code]
aoData.push(
{
'name': 'ids[]',
'value': 1
},{
'name': 'ids[]',
'value': 2
});
[/code]
Allan