• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Debugger Console requesting phantom ; HELP!!!

Contributor ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

error message is listed below and line 241 is the ending "else" statement- I have been through the entire code and found only 1 missing ; in my varibles, which I corrected. I have used Notepad Text editor and looked at all my syntax- I cannot find this error!!!!!! Help!!!!!!   and I also assume since it's not being used in my form that contains the variables since I'm checking for syntax errors in the console that the "Undefined" message means that it can't define some variables?

 

else if ((TTT === "DUPTRT") && (VEHTYPE === "VS") && (cbLien !== "Off") && (cbPTIT !== "Off")) {event.value = 14.75;}
else if ((TTT === "DUPTRT") && (VEHTYPE === "VS") && (cbLien !== "Off") && (cbFTIT !== "Off")) {event.value = 17.25;}

else if ((TTT === "DUPLOST") && (VEHTYPE === "VS") && (cbFTIT !== "Off")) {event.value = 5.00;}
else ((TTT === "DUPLOST") && (VEHTYPE === "VS") && (cbFTIT === "Off")) {event.value = 0.00;}

SyntaxError: missing ; before statement
241:Console:Exec
undefined

TOPICS
JavaScript

Views

274

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 21, 2021 Feb 21, 2021

Use 'else if' on the last line not just 'else'

 

Also in the first line if that is start of your code don't use 'else if' use just 'if'.

Votes

Translate

Translate
Community Expert ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

Use 'else if' on the last line not just 'else'

 

Also in the first line if that is start of your code don't use 'else if' use just 'if'.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

that worked Nesa, but I thought you always had to end with an "else"? Is it ok to end with "else if"?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

LATEST

Yes, it is. That just means that if none of the conditions are met then no action takes place.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

Awesome Nesa! Thanks!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines