I have a list I would sort thanks to the sortable fonction of jQueryUI:
<ul id="list-cat">
<li id="cat_0" >Coach</li>
<li id="cat_1" >Victory</li>
<li id="cat_2" >Defeat</li>
</ul>
My script:
$("#list-cat").sortable({
placeholder: 'highlight',
update: function() {
var order = $('#list-cat').sortable('serialize');
$.post("my url...",order);
alert(order); // displays for example "cat[]=1&cat[]=0&cat[]=2"
}
});
My url receives a $_POST['cat'] array with the $order as key and the $id_cat as value. I need to have the li value (Coach, Victory, etc) as array value instead of the $id_cat, is it possible ?