|
Menus and Navigation >>>
Sends the user to a specific URL based on the combined selections from two different pulldown menus. If the user only selects from one menu, they are still taken to that menu's corresponding page. Works great for sites navigation based on two seperate characteristics.
Add the below code to the <body> section of your page:
<script
language="javascript"
type="text/javascript">
site
=
"http://www.yaldex.com";
function
combineMenus(frm,
menu1,
menu2)
{
with
(frm)
{
str
=
menu1.options[menu1.selectedIndex].value;
str
+=
menu2.options[menu2.selectedIndex].value;
url
=
site +
"/"
+
str +
".html";
window.location.href
=
url;
}
}
</script>
<center>
<form
name=menufrm>
<select
name=menu1>
<option
value="">Make</option>
<option
value="Ford">Ford</option>
<option
value="Chevy">Chevy</option>
<option
value="Toyota">Toyota</option>
</select>
<select
name=menu2>
<option
value="">Year</option>
<option
value="1998">1998</option>
<option
value="1999">1999</option>
<option
value="2000">2000</option>
</select>
<input
type=button
value="Select"
onClick="combineMenus(this.form,
this.form.menu1, this.form.menu2)">
</form>
</center>
|
|