- Forums
- Javascipt
- How To Create A Javascript Jump Select Menu With Example
this is a simple tutorial i wrote to show people how they can make a jump menu using javascript so when there is a menu and as soon as a selection is made it clicks by itself [820], Last Updated: Sat May 18, 2024
wallpaperama
Tue Jun 23, 2009
0 Comments
1585 Visits
creating a jumpmenu using javasript is simple, if you want to make a jump menu i will show you how.
if you are a newby and dont know what a jump menu is, a jumpmenu is simple a menu within a form that as soon as you select the option in the drop down menu, it will automatically take you to the designated url.
for example, lets say i have a form and i have two option,
1. wallpaperama.com
2. webune.com
so lets say that as soon as the user select either webune.com or wallpaperama.com, it will automatically take them to that site. so for this tutorial, i am using a windows xp computer, so i will be using windows notepad. these are that steps of making a jump menu using javascript:
1. open a blank notepad and copy and paste the following code:
<h1>Jump Menu Example</h1>
<hr>
<script type="text/javascript">
<!--
function v3_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<form name="form" id="form">
<select name="jumpMenu" id="jumpMenu" onChange="v3_jumpMenu('parent',this,0)">
<option value="">Select One Choice</option>
<option value="http://www.wallpaperama.com">wallpaperama</option>
<option value="http://www.webune.com">webune</option>
</select>
</form>
<hr>
If you liked this script, check out more scripts for your website at these forums:<br>
<br>
<br>
<a href="http://www.wallpaperama.com">http://www.wallpaperama.com</a> | <a href="http://www.webune.com">http://www.webune.com</a>
2. now save it as jumpmenu.html
3. open jumpmenu.html with your browser and see it in action
let me know if anything doesnt work so i can correct it
thanks