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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:11:26+00:00 2026-06-08T08:11:26+00:00

How can i design multiple drop down lists in jquery having common menu such

  • 0

How can i design multiple drop down lists in jquery having common menu
such that when one is asked to select three preferences using three drop down list
then current drop down list should have only those options from the common menu which were not selected previously

Example:
[drop down list 1]……………..[drop down list 2]…………[drop down list 3]
agra:selected………………….delhi…………………………. mathura
delhi………………………………mathura……………………. delhi:selected
mathura…………………………allahabad:selected
allahabad

  • 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-08T08:11:28+00:00Added an answer on June 8, 2026 at 8:11 am

    Well that’s what a multi-select list is for, but if you really want three separate drop-downs here’s a little something I whipped up for you:

    var $one = $("#one"),
        $two = $("#two"),
        $three = $("#three"),
        $options = $one.children().clone();
    
    $one.change(function() {
        var oneVal = $one.val(),
            twoVal = $two.val();
        $two.empty()
            .append($options.clone().filter(function(){
                                      return this.value != oneVal; }))
            .children().filter(function(){ return this.value == twoVal; })
            .prop("selected",true);
        $two.change();
    });
    
    $two.change(function() {
        var oneVal = $one.val(),
            twoVal = $two.val(),
            threeVal = $three.val();
        $three.empty();
        if (twoVal === "")
            return;        
        $three.append($options.clone().filter(function() {
                return this.value != twoVal && this.value != oneVal;
            }))
            .children().filter(function(){ return this.value == threeVal; })
            .prop("selected",true);
    });
    

    Demo: http://jsfiddle.net/G89m2/

    This assumes you have html something similar to in my demo, i.e., with the available options defined in the first drop-down.

    Some browsers don’t let you use CSS to hide option elements, so the approach I’ve taken is when the selection changes in the first drop-down it removes the options from the second and third and puts back just the ones that are different. If there was a previous selection in the second and third it restores it if it is still available.

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

Sidebar

Related Questions

I have an element that can have multiple types (not my design). The element
I am trying to design a form where I can select multiple records and
Have I understood db design correctly? A user can have one or multiple professions
I'm looking to see if I can design a HtmlHelper extension method that will
Can anyone suggest what software or tools that the best to design icon and
Design requirement: Show a list of items the user can pick from After having
I have a contact manager program that I'd like to design for multiple network
I have this web page I'm developing that displays multiple images of one product
I have 3 entities: Song Artist Genre One song can have multiple genres and
Hey All I'm having a difficult time with a database design. As you can

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.