Script Categories













Menus and Navigation >>> Combined Menu.

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">
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
site = "http://www.yaldex.com"; // Do not include the final "/"
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;
   }
}
//  End -->
</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>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).

click here


©