Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2009
    Posts
    141
    Thanks
    3
    Thanked 20 Times in 20 Posts

    jquery Sortable - cant serialize data

    I have a sortable list that I want to save the items group. To be clear

    List A
    item 1
    item 3

    List B
    item 2

    I move item 2 into list B, then I need to save the fact that item 2 is in list B.

    I have a form where I want, once the submit button is pressed, the lists orders to be saved as data and placed within the form for submission (hidden input) as a value.

    I have tried to use the "toArray( options )" for the sortable UI, however I am using it in conjunction with a plugin to make it multi-selectible. I cannot for the life of me get the array into the from.

    I have the basic setup in a jsfiddle

    Any help much appreciated for this Jquery Noob

  • #2
    Regular Coder
    Join Date
    Jun 2009
    Posts
    141
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Took the dog for a walk when I had my sudden epiphany, put the inputs within the <li> items.

    Code:
    <li><input name="Item12" type="hidden" value="12" />Item 12</li>
    I then use the form normally as I would any other content.

    Working perfectly


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •