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 8988073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:56:23+00:00 2026-06-15T21:56:23+00:00

I have two connected sortables in jQuery. They’re called sortable1 and sortable2. When you

  • 0

I have two connected sortables in jQuery. They’re called sortable1 and sortable2. When you take an element out of sortable2, you put it into sortable1. The user shouldn’t be able to move the element back into sortable2 after dragging has started (a clone is being made to fill the void.) So once dragging has commenced it, how can one keep it from going back into sortable2 while still having full functionality in sortable1?

Thanks for any help in advance!

Here is the script:

<script>
$(function() {
    $( "#sortable1" ).sortable({
        connectWith: ".connectedSortable"                       
    }).disableSelection();
            $('.ui-state-highlight').click(function(){
                    if ($(this).parent().attr("id")!="sortable2") {
                     $(this).remove();
                    }
            });
            $( "#sortable2" ).sortable({
        connectWith: ".connectedSortable",
                    helper: function(e,li) {
                                    copyHelper=li.clone(true,true).insertAfter(li);
                                    return li.clone(true,true);
                                }
    }).disableSelection();
});       
</script>

And here is the snippet of html behind the lists:

<div id="symbolbay">
     <p>Drop symbols here</p>
     <ul id="sortable1" class="connectedSortable"></ul>
</div>
<ul id="sortable2" class="connectedSortable">
    <li class="ui-state-highlight">Click me to delete only me</li>
    <li class="ui-state-highlight">Click me to delete only me</li>
...There are a whole bunch more, finally ending in...
</ul>
  • 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-15T21:56:24+00:00Added an answer on June 15, 2026 at 9:56 pm

    The connectWith paramter is a one way relationship as documented here:
    http://api.jqueryui.com/sortable/#option-connectWith

    So simply specifying #sortable2 connects with #sortable1 but leaving the parameter in #sortable1 blank would do the trick.

    Something like:

    $(function() {
        $( "#sortable2" ).sortable({
            connectWith: "#sortable1"
        })
        $( "#sortable1" ).sortable({
        })
    });
    

    http://jsfiddle.net/69vPK/2/

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

Sidebar

Related Questions

I have two sortable lists in jQuery. They're called sortable1 and sortable2. They are
I have two lists #sortable1 and #sortable 2 which are connected sortables, as shown
I have two lists. They are sortable but not connected (elements of list one
I have two different-sized monitors, connected together using (I believe) TwinView. I tried System.out.println(Toolkit.getDefaultToolkit().getScreenSize());
I have two models, Worker and Project, and they are connected with has_many through
I have two databases on a local machine, connected to localhost . They both
I have two tables and they are connected via the 'debt_key' here are the
Im using jquery sortable and connected lists that works great. I have two lists,
I have two tables connected with one to many relationship. Parent Table is a
I have two tables, username and score . Both are connected using user_id .

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.