## Calculate 4 fields plus a base number? Seems simple? Can't figure it out!

Community Beginner ,
Dec 17, 2018

Copied

Im trying to calculate a total based on numbers typed into 4 fields - which works fine - however, I also have to add a number to that total (a base cost to which the other 4 fields will be added).  In the simplified field notation, I have the following: AACCgraphics+AACCFurniture+AACCFloor+AACCExtras+45500   With the addition of the +45500 into that script, it displays the initial total correctly in the total field, however it doesn't add any numbers from the other fields. I feel like this should be a simple thing to do, but I can't figure it out. Help!

Community Beginner
| Community Beginner

Ah! Perfect!  TypeError (I had not capitalized a letter in the name of the first field)  Works now!  Thank you!

TOPICS
Acrobat SDK and JavaScript

Views

66

Likes

Report

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

## Calculate 4 fields plus a base number? Seems simple? Can't figure it out!

Community Beginner ,
Dec 17, 2018

Copied

Im trying to calculate a total based on numbers typed into 4 fields - which works fine - however, I also have to add a number to that total (a base cost to which the other 4 fields will be added).  In the simplified field notation, I have the following: AACCgraphics+AACCFurniture+AACCFloor+AACCExtras+45500   With the addition of the +45500 into that script, it displays the initial total correctly in the total field, however it doesn't add any numbers from the other fields. I feel like this should be a simple thing to do, but I can't figure it out. Help!

Community Beginner
| Community Beginner

Ah! Perfect!  TypeError (I had not capitalized a letter in the name of the first field)  Works now!  Thank you!

TOPICS
Acrobat SDK and JavaScript

Views

67

Likes

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 17, 2018 0
5 Replies 5
Most Valuable Participant ,
Dec 17, 2018

Copied

It should work... What is the actual outcome when you do it? Did you check the JS-Console for error messages?

Likes

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 17, 2018 1
Community Beginner ,
Dec 17, 2018

Copied

The number never changes... if I delete the +45500 the total adds the 4 fields as expected... Where would the error message appear?

Likes

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 17, 2018 0
Most Valuable Participant ,
Dec 17, 2018

Copied

In the JS-Console. Press Ctrl+J to open it.

Likes

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 17, 2018 0
Community Beginner ,
Dec 17, 2018

Copied

Ah! Perfect!  TypeError (I had not capitalized a letter in the name of the first field)  Works now!  Thank you!

Likes

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 17, 2018 0
LATEST
Most Valuable Participant ,
Dec 17, 2018

Copied

Yes, that's a common mistake, as the names are case-sensitive...

Likes

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 17, 2018 1