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

Syntax error in if statement for checkbox check

New Here ,
Jul 14, 2021 Jul 14, 2021

I am trying to create a field that is only enabled when the checkbox next to it is checked. I managed to write the value to a field so I know it is On vs Off. 

Error says: "SyntaxError: missing ; before statement

1: at line 2

 

Here is my code:

 

If (this.getField("Knowledge arcana").value == "On") {event.value = ( this.getField("INT Modifier").value + this.getField("Ranks16").value ) + this.getField("Misc Mod16").value} else {event.value = ""};

 

Any help is greatly appreciated. 

TOPICS
JavaScript
629
Translate
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
2 ACCEPTED SOLUTIONS
Community Expert ,
Jul 14, 2021 Jul 14, 2021

Use if not If. Javascript is case sensitive.

View solution in original post

Translate
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 ,
Jul 14, 2021 Jul 14, 2021
Translate
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 ,
Jul 14, 2021 Jul 14, 2021

Use if not If. Javascript is case sensitive.

Translate
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
New Here ,
Jul 14, 2021 Jul 14, 2021
LATEST

Wow, I had no idea! That fixed my issue. Thank you so so much!

Translate
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 ,
Jul 14, 2021 Jul 14, 2021

Use if, not If 

Translate
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