Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2002
    Location
    Manchester, England
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dreamweaver List Menu help please

    I'm using Dreamweaver MX 2004.

    I am trying to make a List Menu with different options.

    Could anyne tell me how to link the items to the different pages when the submit button is clicked.

    The code I have is:

    <form action="" method="post" name="menu" id="menu">
    <select name="select">
    <option selected>US 1960</option>
    <option>US 1970</option>
    <option>US 1980</option>
    <option>US 1990</option>
    <option>US 2000</option>
    </select>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" name="Submit" value="Submit">
    </form>

    What I am looking to is that if someone selects US 1970 the clicks the submit button then for it to go to the page usold70.htm

    From US 1980 to link to usold80.htm and so on.
    I cannot figure out how to make these links or where to put them.

    If anyone can help please change the code to show how it should look

    All help much appreciated.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    This should be in the javascript forum, don't cross post it will be moved for you.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script type="text/javascript">
    function goTo(){
    window.location=document.forms[0].theselect.options[document.forms[0].theselect.options.selectedIndex].value;
    return false;
    }
    </script>
    </head>
    
    <body>
    <form action="" method="post" onsubmit="return goTo()">
    <select name="theselect">
    <option value="usold60.htm" selected="selected">US 1960</option>
    <option value="usold70.htm">US 1970</option>
    <option value="usold80.htm">US 1980</option>
    <option value="usold90.htm">US 1990</option>
    <option value="usold90.htm">US 2000</option>
    </select>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" name="Submit" value="Submit">
    </form>
    </body>
    </html>
    DW MX also has a javascript snippet similar to what you want to do, if you press Shift + F9 you will be taken to the snippets area in DW.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Registered User
    Join Date
    Oct 2002
    Location
    Manchester, England
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks aerospance, but there is one problem. If I have 3 menus on one page only the first one works.
    I need 3 menus as they are for car parts of different models of car.

    Also I need to disable the top option of each menu that is selected (P4 Parts - P5 Parts - P6 Parts) so that nothing happens on these options of the submit button is clicked on.

    Could you please help me further. Here is the code I have:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script type="text/javascript">
    function goTo(){
    window.location=document.forms[0].theselect.options[document.forms[0].theselect.options.selectedIndex].value;
    return false;
    }
    </script>
    </head>

    <body>
    <form name="form1" action="" method="post" onsubmit="return goTo()"><select name="theselect">
    <option selected>P4 Parts</option>
    <option>Air Filters</option>
    <option value="shops/p4/p4bodyfront.htm">Bodywork</option>
    <option>Bodywork Rubbers</option>
    <option>Brakes</option>
    <option>Car Covers</option>
    <option>Castrol &amp; Penrite Oils</option>
    <option>Chrome</option>
    <option>Clips</option>
    <option>Cooling System</option>
    </select>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" name="Submit" value="Go">
    </form>

    <form name="form2" action="" method="post" onsubmit="return goTo()"><select name="theselect">
    <option selected>P5 Parts</option>
    <option>Air Filters</option>
    <option value="shops/p5/p5bodyfront.htm">Bodywork</option>
    <option>Bodywork Rubbers</option>
    <option>Brakes</option>
    <option>Car Covers</option>
    <option>Castrol &amp; Penrite Oils</option>
    <option>Chrome</option>
    <option>Clips</option>
    <option>Cooling System</option>

    <form name="form3" action="" method="post" onsubmit="return goTo()"><select name="theselect">
    <option selected>P6 Parts</option>
    <option>Air Filters</option>
    <option value="shops/p6/p6bodyfront.htm">Bodywork</option>
    <option>Bodywork Rubbers</option>
    <option>Brakes</option>
    <option>Car Covers</option>
    <option>Castrol &amp; Penrite Oils</option>
    <option>Chrome</option>
    <option>Clips</option>
    <option>Cooling System</option>
    </select>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" name="Submit" value="Go">
    </form>

    </body>
    </html>



    Hoping you can please help - i'm desperate.
    Last edited by charter; 08-09-2005 at 02:24 PM. Reason: gaps between menus


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •