/    Sign up×
Community /Pin to ProfileBookmark

Drop-down Menu Problem

I have a drop-down menu and when the options are clicked, a function runs to open a new window depending on their value. However, the first option I do NOT want to open anything, and when it is clicked I want nothing to happen. I tried to do this in an if/else statement, and now nothing works. Any help?

[CODE]
function popWindow(secId) {
var loca = document.getElementById(secId).value;
var urlLoca = “directions/” + loca + “.html”;
if (loca == “bad”) {
exit;
} else {
newwindow=window.open(urlLoca,’name’,’height=400,width=550,scrollbars=yes’);
if (window.focus) {newwindow.focus()}
return false;
}
[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@PhilDogMay 06.2007 — [CODE]function popWindow(secId) {
var loca = document.getElementById(secId).value;
var urlLoca = "directions/" + loca + ".html";
if (loca != "bad") {
newwindow=window.open(urlLoca,'name','height=400,width=550,scrollbars=yes');
if (window.focus) {newwindow.focus()}
return false;
}[/CODE]


[B]==[/B] Equal

[B]!=[/B] Does Not Equal
Copy linkTweet thisAlerts:
@AscendancyauthorMay 07.2007 — Oh yea I didn't even think of that. And if it does equal bad, then it will just do nothing?
×

Success!

Help @Ascendancy 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.1,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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