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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:23:39+00:00 2026-05-23T18:23:39+00:00

I have 2 drop downs, I would like to know whether there is a

  • 0

I have 2 drop downs, I would like to know whether there is a possibility to display and hide some of the options in second drop down based on value selected in first dropdown.

<script language="JavaScript">
 function funchk(){
  document.getElementById('z').style.display="block";

  }

    </script>


    <select name="first" onchange="funchk();">
       <option name="asw" value="a">sda</option>
       <option name="sd" value="sd">ZZ</option>
    <option name="rdf" value="afe">fe</option>
       <option name="bfe" value="bfe">fe3</option>
       </select>         <?php echo "<br/>" ?>
     <select name="second">
      <option name="a" value="a">aa</option>
         <option name="z" value="a" style="display:none">ZZ</option>
        <option name="r" value="a" style="display:none">aa</option>
         <option name="b" value="b">bb</option>
         </select>

Here i would like to display the ‘z’ option in 2nd dropdown to be displayed when onchging value of first dropdown.

  • 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-23T18:23:40+00:00Added an answer on May 23, 2026 at 6:23 pm

    No, you can’t rely on setting the CSS to show/hide <option> elements.

    You’ll need to remove them, or just simply disable/enable them.

    function funchk() {
        document.getElementsByName('z')[0].disabled = false;
    }
    

    <select name="second">
        <option name="a" value="a">aa</option>
        <option name="z" value="a" disabled="disabled">ZZ</option>
        <option name="r" value="a" disabled="disabled">aa</option>
        <option name="b" value="b">bb</option>
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I forgot to say there are drop down menus also that I would like
I have a dropdown list (FK) which I would like to set and display
This would be my issue I have a drop down that's not displaying fully.
I have n drop-downs like this: <select id=select1> <option>1</option> <option>2</option> <option>3</option> </select> <select id=select2>
I have a drop down like this on my page: <p> <%= f.label :episode_id
I have a drop down list that has options that need to be passed
Continuing on from this question programmatically creating a drop down list I would like
I would like to create a drop down menu on top of my google
I have a dialog box with a drop down menu like this: Object[] possibilities
In my aspx page, I have a number of drop down controls. I would

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.