/    Sign up×
Community /Pin to ProfileBookmark

Help with ‘else if’ and ‘or’ statement and operator

I’m working on a project and I want to use the following function to check if the user has filled out the needed steps:

[CODE]
function stepCheck() {
if (!(document.OnlineForm.cardoption[0].checked == true || document.OnlineForm.cardoption[1].checked == true))
alert(“Please Select A Payment Option Under Billing Info.”);
}else if(!(document.OnlineForm.shipping[0].checked == true || document.OnlineForm.shipping[1].checked == true || OnlineForm.shipping[2].checked == true)){
alert(“Please Select A Shipping Option.”);
}else if(!(document.OnlineForum.tou.value == true)){
alert(“Please Accept The Terms of Use.”);
}[/CODE]

When I load it, I get a ‘Syntax Error’ message on the first ‘else if’ statement

all help is appreciated, thanks
AhellHound

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@ZABIDec 03.2012 — you were missing those curly braces
[CODE]
function stepCheck() {
if (!(document.OnlineForm.cardoption[0].checked == true || document.OnlineForm.cardoption[1].checked == true))[COLOR="#FF0000"][B]{[/B][/COLOR]
alert("Please Select A Payment Option Under Billing Info.");
}
else if (!(document.OnlineForm.shipping[0].checked == true || document.OnlineForm.shipping[1].checked == true || OnlineForm.shipping[2].checked == true)) {
alert("Please Select A Shipping Option.");
}
else if (!(document.OnlineForum.tou.value == true)) {
alert("Please Accept The Terms of Use.");
}
[COLOR="#FF0000"][B]}[/B][/COLOR]
[/CODE]
Copy linkTweet thisAlerts:
@annieferrisDec 03.2012 — The Thread and data is excellent and informative as well.
×

Success!

Help @AhellHound 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.15,
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,
)...