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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:09:43+00:00 2026-05-29T19:09:43+00:00

I have three dropdown list. By default the values of all three are All.

  • 0

I have three dropdown list. By default the values of all three are “All”. By this value the second and thrid dropdown list will be disabled with “ALL” value. when we change the value of first dropdown list, the second list will be enabled and populte the sub categories related to the category selected on the first list. when we change the value of second list (by default it is “All”), thethird list is enabled and populate the sub categories of the category of second list. all the values are taken from a JSON file: it’s in the format

var accounts = ["WHDH","TF"];


var mediaGroups = {"WHDH": ["WHDH_1","WHDH_2"], "TF": ["TF_1","TF_2"]};


var clipUrls = {"WHDH_1": ["/live/whdh1/1","/live/whdh1/2","/live/whdh1/3"], "WHDH_2": ["/live/whdh2/1","/live/whdh2/2","/live/whdh2/3"], "TF_1": ["/live/tf1/1","/live/tf1/2","/live/tf1/3"], "TF_2": ["/live/tf2/1","/live/tf2/2","/live/tf2/3"]};

The first list is Account, second is Media Groups, Thrid is Clip URLS.

  • 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-29T19:09:44+00:00Added an answer on May 29, 2026 at 7:09 pm

    If you trying to build the select lists based on the objects you specified – try this

    Example HTML :

    <select id="first">
        <option value="all">All</option>
        <option value="WHDH">WHDH</option>
        <option value="TF">TF</option>
    </select>
    
    <select id="second">
        <option value="all">All</option>
    </select>
    
    <select id="third">
        <option value="all">All</option>
    </select>
    

    JavaScript :

    var accounts = ["WHDH","TF"];
    var mediaGroups = {"WHDH": ["WHDH_1","WHDH_2"], "TF": ["TF_1","TF_2"]};
    var clipUrls = {"WHDH_1": ["/live/whdh1/1","/live/whdh1/2","/live/whdh1/3"], "WHDH_2": ["/live/whdh2/1","/live/whdh2/2","/live/whdh2/3"], "TF_1": ["/live/tf1/1","/live/tf1/2","/live/tf1/3"], "TF_2": ["/live/tf2/1","/live/tf2/2","/live/tf2/3"]};
    
    $('#first').change(function() {
        // Remove all options and add the default All option
        $('#second').find('option')
        .remove()
        .end()
        .append('<option value="All">All</option>')
        .val('All');
    
        // loop mediaGroups and add options
        $.each(mediaGroups[$(this).val()], function(key, value) {   
         $('#second')
             .append($("<option></option>")
             .attr("value",value)
             .text(value)); 
        });
    });
    
    $('#second').change(function() {
        // Remove all options and add the default All option
        $('#third').find('option')
        .remove()
        .end()
        .append('<option value="All">All</option>')
        .val('All');
    
        // loop clipUrls and add the values based on other select list
        $.each(clipUrls[$(this).val()], function(key, value) {   
         $('#third')
             .append($("<option></option>")
             .attr("value",value)
             .text(value)); 
        });
    });
    

    Example here -> http://jsfiddle.net/Ac2na/

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

Sidebar

Related Questions

I have DataTable which feeds a dropdown list. The values of this dropdown persist
I have three values I need to align in a dropdown box. How can
I have a drop down list on a form with values: Value One Value
Is there any way to have a dropdown in excel that will show a
I have three tables: page, attachment, page-attachment I have data like this: page ID
I need to have an optional parameter or a parameter that's default value is
I am creating a drop down list of all languages. The default language selection
I have a @Html.DropDownList in the View. I like to default the value of
I have dropdown list control in one of my application and when I add
Assume that I have a dropdownlist with 2 items and, by default, the first

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.