• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to add automated calculated fields.

New Here ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

Hello Everyone,

I am currently using Adobe Acrobat XI Pro and am having trouble adding automated calculated fields. The formula I am looking to add is very simple. This is the general framework I am looking to create:

A: Total cost of computer ___________________ (dollar amount inserted by user)

B: Less 20% _____________________________ (formula would automatically multiply the dollar amount entered by 80%)

C: Total loan amount _______________________ (A minus B will be automatically computed)

D: Amount of terms ________________________ (term quantity will be entered by user)

E: Biweekly deduction ______________________ (C divided by D will be automatically computed)

As you can see, I would like three of these fields to be automated, making the user experience with the PDF file a smooth and seamless function.

Thank you in advance for any guidance provided.

TOPICS
PDF forms

Views

8.1K

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
community guidelines
Community Expert ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Here's an article on using PDF form calculations.

https://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations

I think you could do your calculations with "Simplified Field Notation"

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines
New Here ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

Thank you for responding Thom. Unfortunately my Content Editor only shows the following actions:

  • Edit Text & Images
  • Add Text
  • Add Image
  • Export File to...

More Content

  • Add or Edit Link
  • Add Bookmark
  • Attach a File

Maybe I need to download add-ins?

Votes

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
community guidelines
Community Expert ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

So first you need to add form fields to the page. To do this you need to click on the "Prepare Form" tool, not the "Edit PDF".

Theses videos explain a lot, even though they are for older versions.

Free Video Content & Full Listing of Available Videos

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines
New Here ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Adobe Acrobat.PNGHey Thom,

This is what my Tools section looks like. I'm assuming it is an older version which is causing my confusion. What would the steps be to find "Prepare Form" and to then add the Simplified Field Notation?

Thank you in advance!

Votes

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
community guidelines
Community Expert ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Click on the "Forms" tool, then select "Edit.

This will display a toolbar for adding fields. Fields placed on the form will be outlined the fields with the field names visible. Double click on a field to display the properties dialog, where you will be able to add actions and scripts to the field.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines
New Here ,
Apr 19, 2019 Apr 19, 2019

Copy link to clipboard

Copied

I see! Thank you. So once I've opened the "Text Field Properties" box, hovered over to "Actions", would the select action be "Run a JavaScript"? If so, do you mind assisting me with the wording of the formulas I am attempting to create. I would like the following formulas to be created:

Computer Purchase Program               Cost

          A.                                             *user inputted quantity*

          B.                                             A. times .20

          C.                                             A. minus B.

          D.                                             *user inputted quantity*

          E.                                             C. divided by D.

Votes

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
community guidelines
Community Expert ,
Apr 19, 2019 Apr 19, 2019

Copy link to clipboard

Copied

If you look back in the posts you'll a link to an article on writing calculations. You'll find your answers there.

https://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines
Community Expert ,
Apr 19, 2019 Apr 19, 2019

Copy link to clipboard

Copied

No, it's not under Actions. It's under the Calculate tab.

Votes

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
community guidelines
New Here ,
Oct 17, 2019 Oct 17, 2019

Copy link to clipboard

Copied

I am on Acrobat 19 and don't have the "calculate" tab either. I need to do simple addition, subtraction and @sum calculations. Did Adobe remove the other tabs!? 😞

Votes

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
community guidelines
Community Expert ,
Oct 17, 2019 Oct 17, 2019

Copy link to clipboard

Copied

Is this a Adobe Sign form?

Votes

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
community guidelines
Community Expert ,
Oct 18, 2019 Oct 18, 2019

Copy link to clipboard

Copied

Click on Tools - Prepare Form and then click on "More" at the right side of the window and then on "Revert to Acrobat Form".

Votes

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
community guidelines
New Here ,
Aug 17, 2020 Aug 17, 2020

Copy link to clipboard

Copied

LATEST

THANK YOU!!! I keep seeing people refer to the calculate tab and I didn't have it. Having Creative Cloud, I know I have the most current version. I also didn't think I needed to write a macro for something so simple. So THANK YOU! This solved my problem!! Good to go! *big smiles*

Votes

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
community guidelines
New Here ,
Mar 06, 2020 Mar 06, 2020

Copy link to clipboard

Copied

code for field B:   this.getField("less20").value = this.getField("totalCost").value * 0.20;   

code for field C:    this.getField("totalLoan").value = this.getField("totalCost".value - this.getField("less20").value;

code for field E:

if (!Math.trunc) {
Math.trunc = function (v) {
return v < 0 ? Math.ceil(v) : Math.floor(v);
};

}

this.getField("biWeeklyDed").value = Math.trunc(this.getField("totalLoan").value  / this.getField("termQty").value);

 

Votes

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
community guidelines
Community Beginner ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

This worked for me! Thanks very much—just needed to figure out how to write the code, and this post showed me what the JS formatting would look like in the Custom field. Thanks for this help!

Votes

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
community guidelines