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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:37:34+00:00 2026-05-29T17:37:34+00:00

I have 2 DropDownList.first DropDownList has 4 options.Second DropDownList has 20 options.I want when

  • 0

I have 2 DropDownList.first DropDownList has 4 options.Second DropDownList has 20 options.I want when an option with value = 1 selected in first DropDownList I show All Element in second DropDownList.and if an option with value = 2 selected in first DropDownList I show some of second DropDownList options and So on. How I can do this using jQuery

Edit 1)

Code is :

<div>
    <asp:DropDownList ID="DropDownList1" runat="server" Height="72px" Width="184px">
        <asp:ListItem Value="1">All</asp:ListItem>
        <asp:ListItem Value="2">Apples</asp:ListItem>
        <asp:ListItem Value="2">Orange</asp:ListItem>
        <asp:ListItem Value="3">Onion</asp:ListItem>
    </asp:DropDownList>
    <br />
    <asp:DropDownList ID="DropDownList2" runat="server" Height="18px" Width="187px">
        <asp:ListItem Value="Apple_Style_1">Apple Style 1</asp:ListItem>
        <asp:ListItem Value="Apple_Style_2">Apple Style 2</asp:ListItem>
        <asp:ListItem Value="Apple_Style_3">Apple Style 3</asp:ListItem>
        <asp:ListItem Value="Orange_Style_1">Orange Style 1</asp:ListItem>
        <asp:ListItem Value="Orange_Style_2">Orange Style 2</asp:ListItem>
        <asp:ListItem Value="Orange_Style_3">Orange Style 3</asp:ListItem>
        <asp:ListItem Value="Orange_Style_4">Orange Style 4</asp:ListItem>
        <asp:ListItem Value="Onion_Style_1">Onion Style 1</asp:ListItem>
        <asp:ListItem Value="Onion_Style_2">Onion Style 2</asp:ListItem>
    </asp:DropDownList>
</div>
  • 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-29T17:37:43+00:00Added an answer on May 29, 2026 at 5:37 pm

    You can try this jsFiddle: http://jsfiddle.net/Chran/1/

    HTML

    <div>
    <select ID="DropDownList1" Height="72px" Width="184px">
        <option Value="1">All</option>
        <option Value="2">Apples</option>
        <option Value="2">Orange</option>
        <option Value="3">Onion</option>
    </select>
    <br />
    <select ID="DropDownList2" Height="18px" Width="187px">
        <option Value="Apple_Style_1">Apple Style 1</option>
        <option Value="Apple_Style_2">Apple Style 2</option>
        <option Value="Apple_Style_3">Apple Style 3</option>
        <option Value="Orange_Style_1">Orange Style 1</option>
        <option Value="Orange_Style_2">Orange Style 2</option>
        <option Value="Orange_Style_3">Orange Style 3</option>
        <option Value="Orange_Style_4">Orange Style 4</option>
        <option Value="Onion_Style_1">Onion Style 1</option>
        <option Value="Onion_Style_2">Onion Style 2</option>
    </select>
    </div>​
    

    JavaScript

    var options = $("#DropDownList2").html();
    $("#DropDownList1").change(function(e) {
        var text = $("#DropDownList1 :selected").text();
        $("#DropDownList2").html(options);
        if(text == "All") return;
        $('#DropDownList2 :not([value^="' + text.substr(0, 3) + '"])').remove();
    });​
    

    You will have to change the Id, according to the ASP.Net Control Id.

    Hope this helps you.

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

Sidebar

Related Questions

I have a dropdownlist to fill in server-side an some of the options that
I have a dropdownlist (cboViewAlbums) which has displays album values. The first item is
<asp:DropDownList ID=ddl1 runat=server> <asp:ListItem Text=First Value=1></asp:ListItem> <asp:ListItem Text=Second Value=2></asp:ListItem> </asp:DropDownList> <asp:TextBox ID=tb1 runat=server/> <asp:Button
I have three DropDownLists. If a specific Value from my first DropDownList is chosen,
I have an ASP.NET DropDownList control that retrieves the first and last name from
I have DropDownList with CascadingDropDown extender. If I want to retrieve data from the
I have a dropdownlist with the autopostback set to true. I want the user
I have a dropdownlist in a page. The values of all the list items
I have a AdvancedDatagrid with two columns lets say. First column has item renderer
I have a WebForms page that has two DropDownList controls on it that both

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.