Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How can I get this Drop Down Menu to work without the Go Button
Old 12-19-2008, 05:35 PM How can I get this Drop Down Menu to work without the Go Button
Super Talker

Posts: 101
Trades: 0
A friend of mine wrote this javascript code for me for a simple drop down menu. And it works fine except I don't want the "go" button. So I tried deleting the piece of code that makes up the button but then the links stop working. I know nothing about JS so if anyone will be kind enough to tell me how to alter this code to work without the go button I'll greatly appreciate it. I don't have contact with my friend for this whole week so this is why I'm asking here. Thanks in advance.

The code:

Code:
<form name="jump">
<select name="menu">
<option value="http://www.google.com/">Google</option>
<option value="URL_TO_SITE_HERE">TEXT_HERE</option>
<option value="URL_TO_SITE_HERE">TEXT_HERE</option>
<option value="URL_TO_SITE_HERE">TEXT_HERE</option>
<option value="URL_TO_SITE_HERE">TEXT_HERE</option>
<option value="URL_TO_SITE_HERE">TEXT_HERE</option>
</select>
<input type="button" onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
</form>
Towhid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-19-2008, 06:07 PM Re: How can I get this Drop Down Menu to work without the Go Button
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
<select name="menu" onchange="window.location=this.options[this.selectedIndex].value;">
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-19-2008, 06:13 PM Re: How can I get this Drop Down Menu to work without the Go Button
Super Talker

Posts: 101
Trades: 0
Quote:
Originally Posted by chrishirst View Post
<select name="menu" onchange="window.location=this.options[this.selectedIndex].value;">
Thank You, Thank You, Thank You...

It worked!
Towhid is offline
Reply With Quote
View Public Profile
 
Old 12-19-2008, 06:51 PM Re: How can I get this Drop Down Menu to work without the Go Button
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Of course

How could you doubt it?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-19-2008, 08:53 PM Re: How can I get this Drop Down Menu to work without the Go Button
Super Talker

Posts: 101
Trades: 0
Thanks again chrishirst. Do you know how can I keep the selected option in the menu show as the default when the page reloads. For example if I have a A-Z menu and I select J, when the J page loads I want the selected option to be at J and not the first option in the menu.
Towhid is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How can I get this Drop Down Menu to work without the Go Button
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66721 seconds with 12 queries