Syntaxerror

New Here ,
Dec 12, 2017

Copy link to clipboard

Copied

This is probably way simple but....

I have this script:

var a = this.getField(2 PCT);

var b = this.getField(SUB TOTAL);

event.value = a.value * (b.value / 100)

And get: SyntaxError: missing ) after argument list 1: at line 2

Can someone explain this to me?

Thanks

TOPICS
Acrobat SDK and JavaScript, Windows

Views

72

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

Syntaxerror

New Here ,
Dec 12, 2017

Copy link to clipboard

Copied

This is probably way simple but....

I have this script:

var a = this.getField(2 PCT);

var b = this.getField(SUB TOTAL);

event.value = a.value * (b.value / 100)

And get: SyntaxError: missing ) after argument list 1: at line 2

Can someone explain this to me?

Thanks

TOPICS
Acrobat SDK and JavaScript, Windows

Views

73

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
Dec 12, 2017 0
Adobe Community Professional ,
Dec 12, 2017

Copy link to clipboard

Copied

You need to put quotes around the field names.

var a = this.getField("2 PCT");

var b = this.getField("SUB TOTAL");

event.value = a.value * (b.value / 100)

You might want to run through some of the content here...

JavaScript Tutorial

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...
Dec 12, 2017 1