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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:20:54+00:00 2026-05-29T06:20:54+00:00

I have 4 select boxes, each containing the exact same data: Riding Fishing Smoking

  • 0

I have 4 select boxes, each containing the exact same data:

  • Riding
  • Fishing
  • Smoking
  • Flying

If I’m in select-box[0] and select “Riding”, I want to remove the option from each of the remaining except the current select-box I have active.

I’ve tried select:not(:first-child) but this will remove, only if the first child is the selection, not any of the other.

Basically, I need to remove a selected option from all drop-downs except the one I made the selection on.

  • 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-29T06:20:55+00:00Added an answer on May 29, 2026 at 6:20 am

    Try this:

    $('#select1').on('change', function() {
        var val = this.value;
        $('select').not(this).children().filter(function() {
            return this.value === val;
        }).remove();
    });
    

    i.e. for every <select> that is not this, get its children, but filter the ones whose .value is not the same as mine, and remove them.

    Working demo at http://jsfiddle.net/alnitak/CJYWn/

    If you need to re-add elements when the first entry is changed to something else, you might consider just cloning the entire first select whilst filtering out the unwanted items.

    In this case the filter would need !==, since we want all of the elements except the one that matches, i.e.

    $('#select1').on('change', function() {
        var val = this.value;
        $('select').not(this).empty().append($(this).children().filter(function() {
            return this.value !== val;
        }).clone());
    });
    

    working demo at http://jsfiddle.net/alnitak/ARUmX/

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

Sidebar

Related Questions

I have a select box, from which I want to remove selected choice with
I have... a dynamic populated select box several input boxes a submit button form
I have several select boxes and textboxes with the same class and I have
I have a form with some input and select boxes, each has class=myClass .
I have a web page with many select boxes, which should each contain the
I have multiple select boxes on the page all of which share the same
I have a requirement to supply values from 2 select boxes to an Action
I have a form with two text boxes, one select drop down and one
How to use related select boxes in Symfony ? Let's say, I have a
I'm trying to figure out how to remove options from a select box when

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.