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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:53:18+00:00 2026-06-11T15:53:18+00:00

I have been looking for something similar to what i’m trying to implement but

  • 0

I have been looking for something similar to what i’m trying to implement but haven’t found it on stack or across the net.
Using Jquery Selectable, but have more than one set of ul’s:

<div>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>
</div>

​What i want to be able to do is if i select ‘1’ from any of the options, all the other ‘1’s are disabled. The same goes for all the other selection options, so basically you can only select one of the same options at a time.
I can do this with radio buttons, using the name and value tags, but not really sure how to implement it within the selectable interface?
Thanks ahead for any help or if someone can point me to a similar application.

  • 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-11T15:53:20+00:00Added an answer on June 11, 2026 at 3:53 pm

    You can make only some items selectable using the filter option. After a change is made, you need to go thru all your elements and update the filter according to your needs.

    Sample implementation might look like this (see the live demo here):

    $(document).ready(function() {
    
        function enableAll() {
            $('li').addClass('enabled');
        }
    
        function disableSelected(selected) {
    
            // iterate thru all list items
            $.each($('li'), function(i, item) {
    
                // if the text is selected somewhere..
                if ($.inArray($(this).text().toLowerCase(), selected) >= 0) {
    
                    // ..and it's not here
                    if (!$(this).hasClass('ui-selected')) {
    
                        // remove
                        $(this).removeClass('enabled');
                    }
                }
            });
        }
    
        $('ul').selectable({
    
            // only matching items will be selectable
            filter: '.enabled',
    
            // change handler
            stop: function(event, ui) {
    
                // we will collect selected texts in this variable
                var selectedTexts = new Array();
    
                // go thru all selected items (not only in current list)
                $('.ui-selected').each(function() {
    
                    // extract selected text
                    var text = $(this).text().toLowerCase();
    
                    // add to array if not already there
                    if ($.inArray(text, selectedTexts) < 0) {
                        selectedTexts.push(text);
                    }
                });
    
                // enable all list items for selectable
                enableAll();
    
                // disable list items with text that is already selected
                disableSelected(selectedTexts);
            }
        });
    
        // initialization
        enableAll();
    
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
I have been looking for an answer to this on Stack Overflow, but I
sorry if it's duplicate, I've been looking for something similar before posting, but no
i have been looking around and haven't quite found anything on doing this and
I have been googling for hours looking for something to handle my situation. I
I am looking for some input on something I have been thinking about for
Hobbyist Cocoa programmer here. Have been looking around all the usual places, but this
I have been looking for a decent jQuery validation methodology. I found this jsFiddle
I have been looking over several examples of backgroundworkers and I ran across code
I have been looking on SO and can't seem to find something more recent

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.