/    Sign up×
Community /Pin to ProfileBookmark

Hyperlinks though dropdown menu

I would like to be able to have hyperlinks through an option/dropdown menu. From what I’ve seen the best way of doing this would be through JavaScript. I’ve searched around without finding anything useful as to how to do this. Any pointers or links to tutorials would be appreciated!

Thanks!

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@acorbelliJun 27.2005 — The easiest way is to use a form with the select tag inside it. Catch the onsubmit event and check to see which option they chose. [url="http://www.w3schools.com/htmldom/dom_obj_select.asp"]This is a great place to start[/url]
Copy linkTweet thisAlerts:
@ZeethauthorJun 27.2005 — The easiest way is to use a form with the select tag inside it. Catch the onsubmit event and check to see which option they chose. [url="http://www.w3schools.com/htmldom/dom_obj_select.asp"]This is a great place to start[/url][/QUOTE]

I don't want to have a button of any kind to activate the link. I want to be able to click my created dropdown list and then click any of the options in the list. Once an option is clicked it links to another page.
Copy linkTweet thisAlerts:
@acorbelliJun 27.2005 — That is possible, and easily done the same way (that page will help you with that as well).

But there is a problem when someone browsing via keyboard tries to do it, because as soon as they scroll down with the keyboard it selects the next one, and would navigate them all away.

But, basically, you would capture the onchange instead of onsubmit for the select box.
×

Success!

Help @Zeeth 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 5.4,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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