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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:12:11+00:00 2026-05-23T16:12:11+00:00

I have 2 drop down lists , and value of the second drop down

  • 0

I have 2 drop down lists , and value of the second drop down list should change according to the value selected in first drop down list. The current drop down lists are.

<select name="first">
        <option name="a" value="a">a</option>
        <option name="b" value="b">b</option>
        <option name="c" value="c">c</option>
</select>

<select name="second">
       <option name="a1" value="a1">a1</option>
       <option name="a2" value="a2">a2</option>
       <option name="b1" value="b1">b1</option>
       <option name="b2" value="b2">b2</option>
       <option name="c1" value="c1">c1</option>
       <option name="c2" value="c2">c2</option>
</select>

I want the second drop down to be displayed according to the value selected in First dropdown, ie, if “a” is selected in first then only a1 and a2 should be shown. Also drop down values are pulled from a database
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-23T16:12:12+00:00Added an answer on May 23, 2026 at 4:12 pm

    One option is to load everything you have in the database in a standard form such as JSON. Then, you’d have to write javascript to build the dropdowns dynamically as the user interacts with each item.

    Here is an example of how you’d go about doing it http://jsfiddle.net/9Z5t8/1/

    There are some drawbacks. If you have a LOT of data (hundreds of records) to transfer this will be slow, but it’s okay for a few records.

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

Sidebar

Related Questions

I have two drop down lists: <select name="branch"> <option value="b">Blacksburg</option> <option value="c">Christiansburg</option> <option value="f">Floyd</option>
Suppose I have a drop-down list like: <select id='list'> <option value='1'>Option A</option> <option value='2'>Option
There will be two drop down lists, First have the list of mobile vendor,
for the below drop down list, when i select any value, I have to
I have two drop down lists. Second one is populated based on value chosen
I have a drop down list where users can select a theme for the
Currently, I have two drop down lists that are populated with users' first and
I have two dropdown lists, the second should only be displayed when the value
I have a drop down list on my web page, the selected item of
I have a drop-down list with known values. What I'm trying to do is

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.