jQuery Ajax posting Arrays instead of simple data

Posted by Ignacio on Stack Overflow See other posts from Stack Overflow or by Ignacio
Published on 2010-04-16T03:38:10Z Indexed on 2010/04/16 3:43 UTC
Read the original article Hit count: 365

Filed under:
|
|

Hey, I've tried to update jQuery to its latest version on a system I'm working and I'm having this issue:

I have a file that posts data to a .php:

$.post(

'ajax_Save.php',
{
id: [$('#service_id').val()],
number: [$('#number').val()]
},
    function(data){
...
});

On ajax_Save.php var_dump($_POST) gives:

array(26) { ["id"]=>  array(1) { [0]=>  string(5) "18204" } ["number"]=>  array(1) { [0]=>  string(5) "18250" }...

With jQuery version 1.2.2 the result is:

array(26) { ["id"]=>  string(5) "18204" ["order_number"]=>  string(5) "18250"

Which is OK.

Any clues? Thx

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about php