Log in

View Full Version : Drop Down Menu Links



robzilla
09-13-2005, 12:40 PM
please can anyone help ive got a drop down menu but i cant get it to link to my iframe... it justs loads the link in the page.... can anyone help ( ive tried the target= but it doesnt want to work!!

<div id="Layer2" style="position:absolute; width:30px; height:30px; z-index:2; left: 310px; top: 10px; background-color: #000000; layer-background-color: #000000; border: 1px none #000000;">
<iframe src="splash.html" name="web" frameborder="mo" marginheight="0" marginwidth="0" width="330" height="285"></iframe>
</div>

<br>
<form name="menubar">
<select style="font-size:12px;color:#ffffff;font-family:verdana;background-color:#000000;" name="menu" onChange="location=document.menubar.menu.options[document.menubar.menu.selectedIndex].value;">
<option value=''>CLICK HERE</option>
<option value="http://www.freewebs.com/avengethecrown/main.html">news</option>
<option value="http://www.freewebs.com/avengethecrown/media.html" target="_top">the family</option>
<option value="http://www.freewebs.com/avengethecrown/shows.html">shows</option>
<option value="http://">downloads</option>
<option value="http://">forum</option>
<option value="http://">merch</option>
<option value="http://">links</option>
<option value="http://">contact</option>
<option value="http://">myspace</option>

</select>
</form>

A800
01-14-2008, 03:48 PM
You need Javascript to make links out of the select tag using the <option> tags.



<script type="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
{
if(mySel.form.target)myWin = parent[mySel.form.target];
else myWin = window;
if (! myWin) return true;
myWin.location = myVal;
}
return false;
}
//-->
</script>

Put the above code in your <head> tag.

Then put this in the <form> tag:



<form action="../cgi-bin/redirect.pl"
method=post onSubmit="return dropdown(this.search)">


And in the <select> tag, type this:



<select name="search">


I hope this helps.