Javascript not calculating properly

Community Beginner ,
Oct 11, 2018

Copy link to clipboard

Copied

I am new to javascript. I have a PDF form that adds all the total services [TOTAL SERVICES COSTS]. The next field is TOTAL SERVICES COST 2, where I have used a javascript to deduct 10% for pre pay. It is in the custom calculation field and reads [event.value = Number(this.getField("Total Services Costs").valueAsString) * 0.9]. It is not calculating correctly. Any help is appreciated.

TOPICS
Acrobat SDK and JavaScript, Macintosh

Views

97

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

Javascript not calculating properly

Community Beginner ,
Oct 11, 2018

Copy link to clipboard

Copied

I am new to javascript. I have a PDF form that adds all the total services [TOTAL SERVICES COSTS]. The next field is TOTAL SERVICES COST 2, where I have used a javascript to deduct 10% for pre pay. It is in the custom calculation field and reads [event.value = Number(this.getField("Total Services Costs").valueAsString) * 0.9]. It is not calculating correctly. Any help is appreciated.

TOPICS
Acrobat SDK and JavaScript, Macintosh

Views

98

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
Oct 11, 2018 0
Adobe Community Professional ,
Oct 11, 2018

Copy link to clipboard

Copied

What is wrong?

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...
Oct 11, 2018 1
Community Beginner ,
Oct 11, 2018

Copy link to clipboard

Copied

It doesn't compute at all sometimes, sometimes it returns the wrong answer. Is there anyway to share a file?

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...
Oct 11, 2018 1
Adobe Community Professional ,
Oct 11, 2018

Copy link to clipboard

Copied

Check the field calculation order.

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...
Oct 11, 2018 0