Forum Moderators: open

Message Too Old, No Replies

onchange dropdown to new window?

My simple dropdown form opens in the same window

         

EsterA

7:40 pm on Aug 15, 2006 (gmt 0)

10+ Year Member



Hi,
This form opens the link in the same window. How can I make it open the link in a new window?

<FORM method="post" action="*">
<SELECT name="links" size=1 onChange="if (this.selectedIndex > 0) top.location=this.value" align="left">
<OPTION selected="selected">Select a country</OPTION>
<OPTION value="http://url1.com">Norway</OPTION>
<OPTION value="http://url2.com">Italy</OPTION>
<OPTION value="http://url3.com">Spain</OPTION>
</SELECT>
</FORM>

Help is much appreciated!

supermoi

1:02 am on Aug 17, 2006 (gmt 0)

10+ Year Member



try onChange="if (this.selectedIndex > 0) window.open(this.value)"

There's a few parameters you can change in the .open() method, you might want to look it up.