REVscene - Vancouver Automotive Forum


Welcome to the REVscene Automotive Forum forums.

Registration is Free!You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! The banners on the left side and below do not show for registered users!

If you have any problems with the registration process or your account login, please contact contact us.


Go Back   REVscene Automotive Forum > Vancouver LifeStyles (VLS) > Computer Tech, Gaming & Electronics

Computer Tech, Gaming & Electronics THIS SPACE OPEN FOR ADVERTISEMENT. YOU SHOULD BE ADVERTISING HERE!
Silicon Valley.
Tips & tricks, tech support, home theatre, online gaming, reviews, latest news...

Reply
 
Thread Tools
Old 12-05-2013, 08:52 AM   #1
I contribute to threads in the offtopic forum
 
Spoon's Avatar
 
Join Date: Apr 2001
Location: VAN/RMD/BBY
Posts: 2,596
Thanked 1,022 Times in 450 Posts
Failed 54 Times in 30 Posts
Need Javascript help

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.
Advertisement
Spoon is offline   Reply With Quote
Old 12-05-2013, 09:38 AM   #2
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:
Old 12-05-2013, 09:45 AM   #3
I contribute to threads in the offtopic forum
 
Spoon's Avatar
 
Join Date: Apr 2001
Location: VAN/RMD/BBY
Posts: 2,596
Thanked 1,022 Times in 450 Posts
Failed 54 Times in 30 Posts
Worked like a charm.

Thank you a thousand times if I could.
Spoon is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -8. The time now is 10:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
SEO by vBSEO ©2011, Crawlability, Inc.
Revscene.net cannot be held accountable for the actions of its members nor does the opinions of the members represent that of Revscene.net