Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8348495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:42:23+00:00 2026-06-09T07:42:23+00:00

I have a Jquery Drag Drop List which I want to update immediately in

  • 0

I have a Jquery Drag Drop List which I want to update immediately in MYSQL using Jquery Ajax Post.

Because I can drag elements between lists (more than one list), I need to get the parent ID (parent being list category ID – where the draggable is dragged to)

When I drag from one category / list to another I am always given the former ID..

For example:

CAT 1 ———— CAT 2

If I was to drag something from CAT1 to CAT2 – the ID would be CAT1 and not the new category ID…

I have added my codes below:

Jquery:

<script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/jquery.ui.core.js"></script>
    <script src="js/jquery.ui.widget.js"></script>
    <script src="js/jquery.ui.mouse.js"></script>
    <script src="js/jquery.ui.sortable.js"></script>
<script>
    $(function() {
        $( "#sortable1, #sortable2" ).sortable({
            connectWith: ".connectedSortable"
        }).disableSelection();
    });
    </script>


    <script type="text/javascript">
    $(document).ready(function(){
    $(".mouseup").mouseleave(function(){
    var sparent = $(this).parent().attr("id");
    alert(sparent);
    });
    });
    </script>

LIST HTML:

<div class="demo">
<div class="box">
<ul id="sortable1" class="connectedSortable">
    <li class="ui-state-default mouseup">Item 1</li>
    <li class="ui-state-default mouseup">Item 2</li>
</ul>
</div>
<div class="box">
<ul id="sortable2" class="connectedSortable">
    <li class="ui-state-highlight mouseup">Item 1</li>
    <li class="ui-state-highlight mouseup">Item 2</li>
</ul>
</div>
</div>

Any help would be appreciated.

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:42:25+00:00Added an answer on June 9, 2026 at 7:42 am

    What you want is here:
    http://jqueryui.com/demos/draggable/#events

    $( "#sortable1, #sortable2" ).sortable({
        connectWith: ".connectedSortable",
        stop: function(event, ui) { alert($(ui.item).parent().attr("id") }
    }).disableSelection();
    

    Placing your code in the stop callback will allow you check the right ID.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to do a simple drag-drop using jQuery. I have not done anything
I am using jquery drag-and-drop and I have 3 divs. I want the gallery
I have a drag and drop script using an older version of jquery which
I have a horizontal jquery-ui drag drop list contained in a wrapper in which
I have a gridview for which JQuery drag and drop method is used to
I'm using jQuery UI plugin for drag'n drop my object, But I have a
I have done drag and drop work using with jquery plug-in, Jquery: $(document).ready(function() {
I have a list of <li> items that are dragged using jQuerys drag/drop. I'd
i have done drag and drop using with jquery. here i have issue that
I have two li elements which are jQuery draggable. When I drag and drop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.