/    Sign up×
Community /Pin to ProfileBookmark

help me with dropdown menu please

I need help with a bit of code for a drop down menu on my website. The problem is when i select somthing from the list and click the button to go to it nothing happens. here is the script. I am not very good at this script stuff so if you could help me it would be apreciate.

<SCRIPT language=JavaScript>
<!–

function JumpTo(form)
{
i = form.elements[0].selectedIndex;
window.parent.frames[‘self’].location = form.elements[0].options[i].value;
}
//–>
</SCRIPT>

<DIV><SELECT> <OPTION value=http://geocities.com/o_c_f_m_l/index1.html
selected>Home<OPTION
value=http://geocities.com/o_c_f_m_l/rules.html>Rules<OPTION
value=http://geocities.com/o_c_f_m_l/about.html>About OCFML<OPTION
value=http://geocities.com/o_c_f_m_l/join.html>Join OCFML<OPTION
value=http://geocities.com/o_c_f_m_l/clubs.html>Club Pages<OPTION
value=http://geocities.com/o_c_f_m_l/managers.html>Managers<OPTION
value=http://geocities.com/o_c_f_m_l/transfer.html>Transfer Market<OPTION
value=http://geocities.com/o_c_f_m_l/sponsorship.html>Sponsorships<OPTION
value=http://geocities.com/o_c_f_m_l/training.html>Training<OPTION
value=http://geocities.com/o_c_f_m_l/tfr.html>Tables, Fixtures &amp;
Results<OPTION value=http://geocities.com/o_c_f_m_l/history.html>History &amp;
Awards<OPTION
value=http://geocities.com/o_c_f_m_l/chairman.html>The Chairman<OPTION

value=http://geocities.com/o_c_f_m_l/download.html

>Downloads<OPTION
value=http://geocities.com/o_c_f_m_l/links.html>Links<OPTION
value=http://ocfml.proboards51.com>The Forum<OPTION
value=http://geocities.com/o_c_f_m_l/contact.html>Contact
Us</OPTION></SELECT>&nbsp;<INPUT onclick=JumpTo(this.form) type=submit value=”Go to” name=Submit></DIV>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@cyber1Sep 18.2005 — The problems are numerous.

needed form tags being you are using form calls

the function seems to be part of a larger function

select box had no name

so I came up with this:

[code=html]<form>
<select name="urls" size="1" onChange="window.open(this.options[this.selectedIndex].value,'_blank')">
<OPTION value=http://geocities.com/o_c_f_m_l/index1.htmlselected>Home
<OPTION value=http://geocities.com/o_c_f_m_l/rules.html>Rules
<OPTION value=http://geocities.com/o_c_f_m_l/about.html>About OCFML
<OPTION value=http://geocities.com/o_c_f_m_l/join.html>Join OCFML
<OPTION value=http://geocities.com/o_c_f_m_l/clubs.html>Club Pages
<OPTION value=http://geocities.com/o_c_f_m_l/managers.html>Managers
<OPTION value=http://geocities.com/o_c_f_m_l/transfer.html>Transfer Market
<OPTION value=http://geocities.com/o_c_f_m_l/sponsorship.html>Sponsorships
<OPTION value=http://geocities.com/o_c_f_m_l/training.html>Training
<OPTION value=http://geocities.com/o_c_f_m_l/tfr.html>Tables, Fixtures &amp;Results
<OPTION value=http://geocities.com/o_c_f_m_l/history.html>History&amp;Awards
<OPTION value=http://geocities.com/o_c_f_m_l/chairman.html>The Chairman
<OPTION value=http://geocities.com/o_c_f_m_l/download.html>Downloads
<OPTION value=http://geocities.com/o_c_f_m_l/links.html>Links
<OPTION value=http://ocfml.proboards51.com>The Forum
<OPTION value=http://geocities.com/o_c_f_m_l/contact.html>Contact
</SELECT>
&nbsp;<INPUT type="button" value="Go to" onclick="window.open(this.form.urls[this.form.urls.selectedIndex].value,'_blank')">
</form>
[/code]

-bill
Copy linkTweet thisAlerts:
@the_treeSep 18.2005 — Gah, don't [url=http://www.webdeveloper.com/forum/showthread.php?p=435244]cross post[/url] like that. [b]Cyber1[/b]s awnser is probably a fair bit better than mine.
Copy linkTweet thisAlerts:
@DS_4_lifeauthorSep 19.2005 — actually i found were my mistake was. I acidently deleted the form tags. I deleted this bit of code

<FORM onsubmit="return false" action=# method=post>

and the </form> at the end.

I put that bit of code in and now it works.

Thanks for your help.
×

Success!

Help @DS_4_life spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...