Hello, I am posting successfully an array, but for some reason, the first
element of the array is always missing.

in the text box I get:
topic[]=2&topic[]=1&topic[]=3&topic[]=4&topic[]=5&topic[]=6&topic[]=7
the response box displays
1,3,4,5,6,7 (missing '2'). If I change the order, then the new one in first
position will not post!

but the response code shows

        function register(){
                $.ajax({
                        type: "POST",
                        url: "post.php",
                        data:"data=" + 
document.getElementById("topicarray").value,
                        success: function(html){
                                $("#myresponse").html(html);
                                exit;
                        }

and the php

if($_POST['topic'])
{

$data = implode(',',$_POST['topic'] );

echo $data;
   exit;
} 

Please someone help?
-- 
View this message in context: 
http://www.nabble.com/Ajax-and-array-tp19325836s27240p19325836.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to