Results 1 to 2 of 2
  1. #1
    money001's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Posts
    210
    Reputation
    5
    Thanks
    19
    My Mood
    Stressed

    Need help with Java Script Combo Box

    Hi, so i'm trying to develop a combo box where if the user selects one option, it will show a list of options and if the user selects a different option all of the options change. And when the page loads the page is empty except for the one combo box, and more pop up as it goes along. Here is my current code that i've got, and it works for one way, but i need it two+ ways.

    Code:
    Code for Drop down menu show more options (only working for 1 option currently)
    
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    	<title>Test</title>
        <script type="text/javascript">
            <!--
                function officeSelect() {
                    var other = document.getElementById("officeShow");
                    if (document.forms[0].theItems.options[document.forms[0].theItems.selectedIndex].value == "office") {
                        other.style.visibility = "visible";
                    }
                    else {
                        other.style.visibility = "hidden";
                    }
                }
            //-->
        </script>
    </head>
    <body>
    <form action="" method="">
        <select name="theItems" onchange="officeSelect()">
            <option value="-1">Select...</option>
            <option value="home">Home</option>
            <option value="office">Office</option>      
        </select>
        <div style
        <div id="officeShow" style="visibility: hidden;">
            Office Stuff: <input name="officeField" type="text" /> 
        </div>
    </form>
    
    
    </body>
    </html>
    Thanks to any one who can help me

  2. #2
    Web-Designer's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Arizona, USA
    Posts
    270
    Reputation
    11
    Thanks
    53
    My Mood
    Fine
    Below is a link to something like what your describing, if that doesn't help much then message me and I'm sure I can help you with it.

    Code:
    https://tutorialzine.com/2011/11/chained-ajax-selects-jquery/
    Last edited by Web-Designer; 01-24-2012 at 10:03 PM.
    Code:
    Looking for some project(s) to dedicate my time to! I know HTML, PHP, MySQL and JavaScript.
    
    
    - Message me if I can help you with something, all I want is some credit!

Similar Threads

  1. [Help Request] Need help with my Script
    By hannemannen in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 8
    Last Post: 11-08-2011, 02:08 PM
  2. [Solved] need help with java
    By abonabel in forum CrossFire Help
    Replies: 5
    Last Post: 08-03-2011, 02:17 PM
  3. [Help] need help with rs scripts
    By Idrawheart in forum Runescape Hacks / Bots
    Replies: 1
    Last Post: 04-27-2011, 08:50 PM
  4. need help with weapond script
    By pepelas2 in forum WarRock Help
    Replies: 2
    Last Post: 04-16-2011, 12:38 AM
  5. [Request] Need help with log in box!!
    By lolipop12345 in forum CrossFire Mods & Rez Modding
    Replies: 6
    Last Post: 06-11-2010, 03:14 AM