Need help with syntax error 4: at line 5

New Here ,
May 16, 2019

Copy link to clipboard

Copied

The only way this field should populate a yes answer is the first If statement. Any other combination should return a No. What am I missing?

Thanks for the help!

var A = this.getField("QualifyingPercentage").value;

var B = this.getField("CiscoSKU").value;

event.value = "";

if(A>.749000)&& B = Yes)event.value = "Yes";

else if(A>.749000)&& B = No)event.value = "No";

}

TOPICS
Acrobat SDK and JavaScript, Windows

Views

138

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

Need help with syntax error 4: at line 5

New Here ,
May 16, 2019

Copy link to clipboard

Copied

The only way this field should populate a yes answer is the first If statement. Any other combination should return a No. What am I missing?

Thanks for the help!

var A = this.getField("QualifyingPercentage").value;

var B = this.getField("CiscoSKU").value;

event.value = "";

if(A>.749000)&& B = Yes)event.value = "Yes";

else if(A>.749000)&& B = No)event.value = "No";

}

TOPICS
Acrobat SDK and JavaScript, Windows

Views

139

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
May 16, 2019 0
Most Valuable Participant ,
May 16, 2019

Copy link to clipboard

Copied

Count the number of opening and closing parentheses.

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
Reply
Loading...
May 16, 2019 0
Most Valuable Participant ,
May 16, 2019

Copy link to clipboard

Copied

Also, the comparison operator in JS is "==", not "=", although that's not a syntax error.

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
Reply
Loading...
May 16, 2019 0
Adobe Community Professional ,
May 16, 2019

Copy link to clipboard

Copied

You've got three issues.

1. Yes and No are string literal values, not variable names. They need to be quoted.

2. "=" is the assignment operator. To compare values use the equivalence operator "=="

3. Brackets and parentheses come in pairs, an opening and a closing, You have missmatched items in several places.

All programming is about details. You should consider spending some time going over your script and learning a few things about JavaScript.

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
Reply
Loading...
May 16, 2019 0
New Here ,
May 16, 2019

Copy link to clipboard

Copied

Aware my java is very rusty - which is why I reached out for help. Thank you for the suggestions.

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
Reply
Loading...
May 16, 2019 0
Adobe Community Professional ,
May 16, 2019

Copy link to clipboard

Copied

Info: It is Javascript, not Java.

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
Reply
Loading...
May 16, 2019 0
New Here ,
May 16, 2019

Copy link to clipboard

Copied

Got it - was in a rush to fix the issue.

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
Reply
Loading...
May 16, 2019 0