View Single Post
Old 12-05-2013, 09:38 AM   #2
iamed
Banned By Establishment
 
Join Date: Feb 2008
Location: https://t.me/pu
Posts: 453
Thanked 201 Times in 33 Posts
Failed 4 Times in 4 Posts
Use window.open instead:

<select name="menu" onChange="window.open(this.options[this.selectedIndex].value);" value="GO">


Quote:
Originally Posted by Spoon View Post
Kind of noob when it comes to javascript. Can anyone help me out and edit the following code so it would open a new window when one of the options get clicked? It's currently opening in the same window.

-------------------

<form name="cityselect">

<select name="menu" onChange="window.document.location.href=this.optio ns[this.selectedIndex].value;" value="GO">

<option selected="selected">Select a City</option>

<option value="http://www.vancouver.com">Vancouver</option>

<option value="http://www.calgary.com">calgary</option>

<option value="http://www.edmonton.com">Edmonton</option>

</select>

</form>

-------------------
Thanks!

Note: not sure why there's a space placed between the word options when I publish the post, but it's not suppose to be there.
iamed is offline   Reply With Quote
This post thanked by: