Click to See Complete Forum and Search --> : Drop Down Menu Links


Bungholio
03-24-2003, 01:19 AM
Hi, thanks for looking,

Im going to be using a drop down menu for the navigation of my site. The drop down menu is in an Iframe within the main index.html page. When someone selects an option it should open the new page in the parent window. Here's what ive got so far;

<script type="text/javascript">
menuLink=function(url) {
window.open(url)
</script>
<body>
<SELECT onChange=menuLink(this)>
<OPTION selected>Menu</OPTION>
<OPTION value=link1>Link 1</OPTION>
<OPTION value=link2>Link 2</OPTION>
<SELECT>

Also VERY important to note, link1 will open http://www.mydomain.com/link1/ and the page you are on now is http://www.mydomain.com/index.html

Am I on the right track? Im a JS newbie...so if you can help me get this right, please be descriptive...thanks! Al

khalidali63
03-24-2003, 07:42 AM
You seem to be on right track.Here is what you need to do.

first make sure that you have correct url values in the drop down options or you have an array of correct urls and the drop down list only contains their respective index value.

second you need to pass that value to your function,
then in the function use this
top.window.location.href = url;
the code you already have
window.open() will open the4 link in new window.

Cheers

Khalid