Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-05-2010, 03:26 PM   PM User | #1
cbc58
New to the CF scene

 
Join Date: Nov 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
cbc58 is an unknown quantity at this point
jumping to object (webpage) from select ?

Hello,

I am trying to utilize the 2 level select menu found here in this tutorial: http://www.javascriptkit.com/javatut...content2.shtml , except when the object is selected a message pops up on the screen -- and instead I need it to actually take users to an existing website/webpage.

How would this get changed to do that??? or is there another 2 level select menu that has that already coded that someone could point me to...

tks.
cbc58 is offline   Reply With Quote
Old 11-06-2010, 09:34 AM   PM User | #2
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Change the option value to the corresponding url.

Code:
cities[1]=["New York|http://www.google.com/", "Los Angeles|http://www.yahoo.com", ...
Then remove the onclick on the cities dropdown and change it to onchange

Code:
<select name="cities" size="4" style="width: 150px" onchange="if (this.value) location.href=this.value;">
If you want it to open in a new window instead of the same window:
Code:
<select name="cities" size="4" style="width: 150px" onchange="if (this.value) window.open(this.value, '_blank');">
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Users who have thanked glenngv for this post:
cbc58 (11-06-2010)
Old 11-06-2010, 01:40 PM   PM User | #3
cbc58
New to the CF scene

 
Join Date: Nov 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
cbc58 is an unknown quantity at this point
Tks Glenn.
cbc58 is offline   Reply With Quote
Reply

Bookmarks

Tags
java, menu, selectable

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:43 PM.


Advertisement
Log in to turn off these ads.