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

  • Home
  • SEARCH
  • 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 8311953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:59:17+00:00 2026-06-08T19:59:17+00:00

I want to a dropdown menu that if I select value1 I get a

  • 0

I want to a dropdown menu that if I select value1 I get a couple of input fields, and if I select value2 I get some other input fields. So I found this code online, and I’m trying to adjust it to my needs. Unfortunately it doesn’t work, the tables are ALWAYS showing. If I don’t work with tables (just plain text) the code works.

Javascript

<script type='text/javascript' src='http://jsfiddle.net/js/lib/mootools-core-1.4.5-nocompat.js'></script>
<script type='text/javascript'> 

function showForm(id) {
    document.getElementById('submitForm').style.display = "block";
    if (id == 0) {
        document.getElementById('submitForm').style.display = "none";
    }
    for (var i = 1; i < 4; i++) {
        if (i == id) {
            document.getElementById(i).style.display = 'block';
        } else {
            document.getElementById(i).style.display = 'none';
        }
    }
}
</script>

HTML

<table>
        <tr>
            <td>Selecteer uw materiaal: </td>
            <td>
            <select id="dropdownMenu" name="dropdownMenu" onchange="javascript: showForm(document.getElementById('dropdownMenu').value);">
                <option value="0">Choose an option</option>
                <option value="1">Option 1</option>
                <option value="2">Option 2</option>
                <option value="3">Other</option>
            </select></td>
        </tr>
    <div id="1" style="display: none;">
    <tr>
        <td>Aantal videobanden: </td>
        <td><input type="text" name="aantalVideo" value="" /></td>
    </tr>
    <tr>
        <td>Geschatte speelduur (in minuten): </td>
        <td><input type="text" name="duurVideo" value="" /></td>
    </tr>
    </div><!-- /1 -->
    <div id="2" style="display: none;">
    <tr>
        <td>Aantal spoelen: </td>
        <td><input type="text" name="aantalSpoelen" value="" /></td>
    </tr>
    <tr>
        <td>Geschatte speelduur (in minuten): </td>
        <td><input type="text" name="duurSpoelen" value="" /></td>
    </tr>       
    </div><!-- /2 -->
    <div id="3" style="display: none;">
    <tr>
        <td>&nbsp;</td>
        <td>Overig</td>
    </tr>
    </div><!-- /3 -->
    <div id="submitForm" style="display: none;">
    <tr>
        <td>&nbsp;</td>
        <td><input value=" Order aanmaken " type="submit"></td>
    </tr>
    </div><!-- /submitForm -->
    </table>
  • 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-08T19:59:21+00:00Added an answer on June 8, 2026 at 7:59 pm

    Why dont you give those id’s to tr elements rather than creating div’s. I tried changing some of the page structure. It worked. I assigned the ids given to the div elements to the tr elements in them and it worked.

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

Sidebar

Related Questions

I want to create a dynamic select input (dropdown menu) from JSON. I have
I have a CSS dropdown menu that is functioning how I want it to
I have a UL LI menu that I am turning into a select dropdown
I have a simple html option/select (dropdown) menu. I want to use JQuery to
So, basically I have this select / drop down menu that I use AJAX
I have a dropdown menu on my site that I want to use to
I have a dropdown menu with a couple of values that link to functions.
I have a select element that functions as a dropdown menu. Each option has
I want to constrain the width of an <ul> tag in a dropdown menu
i want to develop dropdown inside a check box . this url shows me

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.