PDA

View Full Version : open Drop-Down menu link in new window



werstin
Dec 2nd, 2002, 04:31 PM
This script is working fine, except I'd like the link to open in a new window. It is a drop-down menu form with a 'Go' button image. Any help is greatly appreciated!

<body>

<form name="jump">

<script>
function jumpMenu(){
location=window.jump.menu.options[window.jump.menu.selectedIndex].value;
}
</script>

<select name="menu"><option selected>Select:</option>
<option value="http://www.yahoo.com">Yahoo!</option>
</select>
<a href="Javascript:jumpMenu()"><IMG SRC="images/go.gif" border=0></a>

</form>

</body>

ShriekForth
Dec 2nd, 2002, 05:03 PM
You can change the function to this....


function jumpMenu(){
newWin=window.open(document.jump.menu.options[document.jump.menu.selectedIndex].value,"","width=800,height=600");
}


Setup whatever you need/want to for window attributes. In the example, I just have the height and width.

ShriekForth

werstin
Dec 2nd, 2002, 05:20 PM
That worked perfectly!!!
Thank you so much for your help!!! :thumbsup: