How do I get drop-down menu to open links in new window?

How do I get a drop-down menu to open the links in it in a new window?

I have tried adding TARGET="_BLANK at various places on the form, but to no avail, the links still open in the current window.

I know it’s possible if I have a ‘GO’-type button that is clicked after an option is selected, but I prefer a drop-down menu that works automatically without having to press the ‘GO’ button.

<FORM NAME=“nav”><DIV>
<SELECT NAME=“SelectURL” onChange=
“document.location.href=
document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value” TARGET=“_BLANK” >
<OPTION VALUE=“http://www.freefind.cjb.net
SELECTED>Please select an option:
<OPTION VALUE=“http://CDUK.Best.CD”>
CD UK - Music Shopping
<OPTION VALUE=“http://TopSitesUK.cjb.net”>
TopSites UK - Britain’s Best Websites
</SELECT><DIV>
</FORM>

Can anybody help me please?

Thanks…

Have you tried it in the actual <FORM> tag?

Hey nazam,

Instead of using this:

<SELECT NAME="SelectURL" onChange="document.location.href=document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value" TARGET="_BLANK" >

use this:

<select name="SelectURL" onchange="window.open(document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value)">

aDog :cool:

Thank you :slight_smile:

You can now see the script working at http://www.UKHotMovies.com/welcome.shtml - thanks to you!

You are welcome.

Just curious, but why is the Karma on that post negative?

aDog :confused:

Beats me - you rock the JavaScript world here, and I gave you Karma for your post - it was dead on, and was 100% what he was looking for.