Sortable with connectedWith Serialize problems

Sortable with connectedWith Serialize problems


Hello fellow Jquery users,
Im a rookie, and got stuck with my scripting.
I simply dont know how to post 2 Array's with Jquery to PHP (1 with
the PAGES and 1 with the "OTHER PAGES").
My script (which only produces 1 array from the active <ul>:
<script type="text/javascript">
$(document).ready(function(){
$(function() {
$("#sortable1, #sortable2").sortable({ opacity: 0.6, connectWith:
'.connectedSortable', cursor: 'move', update: function() {
    var order = $(this).sortable("serialize") +
'&action=updateRecordsListings';
    $.post("updateDB.php", order, function(theResponse){
        $("#contentRight").html(theResponse);
    });
    }
});
});
});
</script>
The HTML:
<h1>Pages</h1>
<ul id="sortable1" class="connectedSortable">
    <li class="ui-state-default" id="recordsArray_1">Item 1</li>
    <li class="ui-state-default" id="recordsArray_2">Item 2</li>
    <li class="ui-state-default" id="recordsArray_3">Item 3</li>
    <li class="ui-state-default" id="recordsArray_4">Item 4</li>
    <li class="ui-state-default" id="recordsArray_5">Item 5</li>
</ul>
<h1>Other pages (not shown in menu)</h1>
<ul id="sortable2" class="connectedSortable">
    <li class="ui-state-highlight" id="recordsArray_6">Item 6</li>
    <li class="ui-state-highlight" id="recordsArray_7">Item 7</li>
    <li class="ui-state-highlight" id="recordsArray_8">Item 8</li>
    <li class="ui-state-highlight" id="recordsArray_9">Item 9</li>
    <li class="ui-state-highlight" id="recordsArray_10">Item 10</li>
</ul>
<div id="contentRight">
    

Array will be displayed here.


    

&nbsp;


</div>
PHP:
$action             = $_POST['action'];
$updateRecordsArray     = $_POST['recordsArray'];
if ($action == "updateRecordsListings"){
    echo '<pre>';
    print_r($updateRecordsArray);
    echo '</pre>';
}

















































    • Topic Participants

    • wex69