/    Sign up×
Community /Pin to ProfileBookmark

OnClick selection issue

Hi there all I am having an issue with using an onclick menu it works fine in some ie browsers not all? and firefox but does not work at all in Safari.
could someone please point me into the right direction as this is now driving me crazy as to get it working.

Please HELP!!

<select name=”select”>
<option onclick=”location.href=’contact.html'”>English</option>
<option onclick=”location.href=’/main/language/francais/contact.html'”>Français</option>
<option onclick=”location.href=’/main/language/deutch/contact.html'”>Deutch</option>
<option onclick=”location.href=’/main/language/italiano/contact.html'”>Italiano</option>
<option onclick=”location.href=’/main/language/espanyol/contact.html'”>Españyol</option>
</select>

help me please

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@CharlesAug 11.2011 — 1) Do not [i]rely[/i] on JavaScript for navigation! It will fail for so many users that in some cases it's actually against the law.

2) Options don't have, or aren't supposed to have, onclick handlers.

So put that in a proper form, with a submit button, and use something like:
&lt;form action="JavaScript_free_default_action.php" onsubmit=return this_part_gets_more_complicated_but_you_will_figure_it_out()"&gt;
Copy linkTweet thisAlerts:
@rtretheweyAug 11.2011 — onClick is going to be unreliable for <option> tags. It would be best to add an onChange() function to the <select> tag that fetches the current selection value for your call to location.href.
×

Success!

Help @pasquith 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.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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