## Adobe Support Community

• Global community
• Language:
• Deutsch
• English
• EspaĆ±ol
• FranĆ§ais
• PortuguĆŖs
• ę„ę¬čŖć³ćć„ććć£
Dedicated community for Japanese speakers
• ķźµ­ ģ»¤ė®¤ėķ°
Dedicated community for Korean speakers
Exit Search
• I have 2 rather complicated forms and I am looking...

# I have 2 rather complicated forms and I am looking for some help. TIA!

Community Beginner ,
Nov 30, 2022 Nov 30, 2022

Copy link to clipboard

Copied

I have 2 rather complicated forms and I am looking for some help. I am not sure if Javascript should be used here. I maybe over thinking this!

CALCULATION 1

#___________ of trucks
x \$ ___________ \$8,000 (per CPC)
x \$ ___________ \$10,000 (per truck in other repairs)
+ ___________ labor & taxes

___________________________________________
= \$ ___________ total repairs

____________________________________________________________________

CALCULATION 2
#___________ of trucks
x \$ ___________ \$ rate per day
___________________________
x___________ 90 days to get CPC module
___________________________
x___________ 10 days for repairs
___________________________
+ #___________ hours spent focusing on the incident
x \$___________ hourly rate
___________________________
= \$___________ total lost revenue

TOPICS
General troubleshooting , How to , JavaScript , PDF forms

Views

945

Report

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

## 2 Correct answers

Community Expert , Nov 30, 2022 Nov 30, 2022

If it's a simple calculation, you can use simplified field notation. Can you provide field names included in calculation with an example how it should look?

Community Expert , Dec 01, 2022 Dec 01, 2022

There is no need for JavaScript.

See attachement.

6 Replies 6
Community Expert ,
Nov 30, 2022 Nov 30, 2022

Copy link to clipboard

Copied

If it's a simple calculation, you can use simplified field notation. Can you provide field names included in calculation with an example how it should look?

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 Beginner ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

Hi Nesa, Here are the field names in ( BOLD). I also attached a picture of what it will look like. Thank you for your help. š Sheryl

CALCULATION 1

#___________ of trucks (Tab1-1)
x \$ ___________ \$8,000 (per CPC) (Tab1-2)
x \$ ___________ \$10,000 (per truck in other repairs) (Tab1-3)
+ ___________ labor & taxes (Tab1-4)

___________________________________________
= \$ ___________ total repairs (Tab1-total)

____________________________________________________________________

CALCULATION 2
#___________ of trucks (Tab2-1)
x \$ ___________ \$ rate per day (Tab2-2)
___________________________
x___________ 90 days to get CPC module (Tab2-3)
___________________________
x___________ 10 days for repairs (Tab2-4)
___________________________
+ #___________ hours spent focusing on the incident (Tab2-5)
x \$___________ hourly rate (Tab2-6)
___________________________
= \$___________ total lost revenue (Tab2-total)

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 Expert ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

As custom calculation script of "Tab1-total" field use this:

var t1 = Number(this.getField("Tab1-1").valueAsString);
var t2 = Number(this.getField("Tab1-2").valueAsString);
var t3 = Number(this.getField("Tab1-3").valueAsString);
var t4 = Number(this.getField("Tab1-4").valueAsString);
event.value = (t1*t2)+(t1*t3)+t4;

As custom calculation script of "Tab2-total" use this:
var c1 = Number(this.getField("Tab2-1").valueAsString);
var c2 = Number(this.getField("Tab2-2").valueAsString);
var c3 = Number(this.getField("Tab2-3").valueAsString);
var c4 = Number(this.getField("Tab2-4").valueAsString);
var c5 = Number(this.getField("Tab2-5").valueAsString);
var c6 = Number(this.getField("Tab2-6").valueAsString);
event.value = (c2*(c3+c4)*c1)+(c6*c5);

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 Beginner ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

Thank you so very much. I think is works perfectly! The finished file is attached for you to review.

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 Expert ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

There is no need for JavaScript.

See attachement.

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 Beginner ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

LATEST

Thank you for your support. I used some of your functions along with Nesa's it in combination I thin works very well. I have attached the file. It has been a few years since I have had to apply any calculations to a PDF. š