Howto serialize multiple Lists with Jquery

Posted by megens on Stack Overflow See other posts from Stack Overflow or by megens
Published on 2010-05-29T23:52:59Z Indexed on 2010/05/30 0:02 UTC
Read the original article Hit count: 270

I have 3 sortable UL's and a simple jquery/javascript

<ul class="sortable" id="menu1">
<li id="id_1">whatever</li>
<li id="id_2">you</li>
</ul>
<ul class="sortable" id="menu2">
<li id="id_3">wanne</li>
<li id="id_4">put</li>
</ul>
<ul class="sortable" id="menu3">
<li id="id_5">in</li>
<li id="id_6">here</li>
</ul>

$(function() {
    $("ul.sortable").sortable({
        connectWith: 'ul'
        });
    });
</script>

LI's are draggable between UL's How can i serialize this so i get for example menu1[0]=1&menu1[1]=3 Or and array or whatever i can work with to save the state?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui