...

View Full Version : Dreamweaver List Menu help please



charter
08-03-2005, 06:47 PM
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.

_Aerospace_Eng_
08-03-2005, 06:58 PM
This should be in the javascript forum, don't cross post it will be moved for you.

<!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.

charter
08-09-2005, 12:57 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum