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

  • Home
  • SEARCH
  • 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 5970227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:20:39+00:00 2026-05-22T20:20:39+00:00

I need to be able to clone a drop down list and filter only

  • 0

I need to be able to clone a drop down list and filter only those options that were NOT yet selected in the group of select lists.

For example, having the following:

<select name="SelectService" class="selService">
<option value="1">Some service</option>
<option value="2">Another one</option>
<option value="3">One more</option>
</select>

When i click the “clone” button it would clone the select list with ONLY those options that have NOT been yet selected.

ex: select option “Some service” -> hit clone -> new select list is added with only option values: 2 and 3.

etc..cloning and removing select lists would re-fill the select lists based on options selected so far.

EDIT:
to better visualize it here is the screen shot:
enter image description here

SCENARIO:

  1. i start off with only 1 drop down
    list (that has 5 options) =>
    1,2,3,4,5 -> first options is selected by default.
  2. I hit clone ->
    new list is added with ONLY options
    2,3,4,5.
  3. i select option 5 (in select list

    2)

  4. I hit clone -> new list (#3) is added
    with ONLY options 2,3,4
  5. i select option 2 (in select list

    3)

  6. I hit clone -> new list (#4) is
    created with options 3,4

..and so on.

Now, When I remove Select list #2 (or any other select list) that means ALL select lists should re-fresh and include the selected option from deleted select list (in our case #2)

Help.
thanks

  • 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-05-22T20:20:41+00:00Added an answer on May 22, 2026 at 8:20 pm

    This seems to do what you want: http://jsfiddle.net/infernalbadger/SKVSu/1/

    $('#clone').click(function() {
        var original = $('select.selService:eq(0)');
        var allSelects = $('select.selService');
        var clone = original.clone();
    
        $('option', clone).filter(function(i) {
            return allSelects.find('option:selected[value="' + $(this).val() + '"]').length;
        }).remove();
    
        $('#target').append(clone).append('<br />');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to get a list of the groups a user
I'm attempting to make a dynamic drop down that will be filled by a
I need to be able to create basic MS Project items (tasks, projects, resources,
I need to be able to get at the full URL of the page
I need to be able to merge two (very simple) JavaScript objects at runtime.
I need to be able to load the entire contents of a text file
I need to be able to quickly convert an image (inside a rails controller)
I need to be able to GZip compress a file in an Excel VBA
I need to be able to periodically send email alerts to subscribed users. PHP
I need to be able to take a string like: '''foo, bar, one, two,

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.