How to send a Jquery ordered list to a php script via Jquery?
<p>I have a problem concerning Ajax and Jquery.
I have a bunch of <code>&lt;li&gt;</code> elements which can be sorted with Jquery. There are also hidden fields for each <code>li</code> element. These hidden fields all have the name <code>list[]</code>. This way PHP will create an array containing the content of the hidden fields.
Now I am trying to implement an autosave option. This means, every 30 seconds or so the order of the li elements will automatically be saved in a mysql database.
My try until now is this:</p>

<pre><code>$(document).ready(function(){ 
autosave(); 
});

function autosave() 
{ 
var t = setTimeout("autosave()", 500);
    $.ajax( 
    { 
        type: "POST", 
        url: "autosave.php", 
        data: "list[]="  + list, 
        cache: false,
            success: function(message)
            {   
                $("#autosave").empty().append(message);
            }

    }); 
}
</code></pre>

<p>For testing purposes the autosave.php will just output a text just to see whether the jquery works. So I found out that the problem is the <code>data: "list[]=" + list</code>. This wont send my values from the hidden fields to the autosave.php.</p>

<p>Does anybody have an idea what is my mistake and how I can send the array list to my autosave.php?</p>

<p>Thanks for help
phpheini</p>
