Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Syntax error in if statement for checkbox check

New Here ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

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

Views

32

Likes

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 2 Correct answers

Adobe Community Professional , Jul 14, 2021 Jul 14, 2021
Use if not If. Javascript is case sensitive.

Likes

Translate

Translate
Adobe Community Professional , Jul 14, 2021 Jul 14, 2021
Use if, not If 

Likes

Translate

Translate
Adobe Community Professional ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

Use if not If. Javascript is case sensitive.

Likes

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

Copy link to clipboard

Copied

LATEST

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

Likes

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
Adobe Community Professional ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

Use if, not If 

Likes

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