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

Simple Calculate Formulas

Explorer ,
Feb 23, 2022 Feb 23, 2022

Is there a simple way to create the following calcualtion in an interactive pdf -

(Text Field A) + (Text Field B) - (Text Field C) = (Text Field D)

 

Thanks

 

Jack

TOPICS
How to , PDF forms
783
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Feb 24, 2022 Feb 24, 2022
LATEST

"I've just discovered that the calculation does work but only if there are no spaces in the 'TextFieldD' name."

Blank spaces and dots must be escaped using a backslash, like this:

Text\ Field\ A + Text\ Field\ B - Text\ Field\ C = Text\ Field\ D


Acrobate du PDF, InDesigner et Photoshopographe

View solution in original post

Translate
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 ,
Feb 23, 2022 Feb 23, 2022
Translate
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
Explorer ,
Feb 23, 2022 Feb 23, 2022

Thanks for the link. I've just discovered that the calculation does work but only if there are no spaces in the 'TextFieldD' name. See... and I can spell 'calculation' properly too! : )

 

Translate
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 ,
Feb 23, 2022 Feb 23, 2022

You might also be interested in this article, which covers writing simple JavaScript calculations:

https://www.pdfscripting.com/public/How-to-Write-a-Basic-PDF-Calculation-Script.cfm

 

 

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

Translate
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 ,
Feb 24, 2022 Feb 24, 2022
LATEST

"I've just discovered that the calculation does work but only if there are no spaces in the 'TextFieldD' name."

Blank spaces and dots must be escaped using a backslash, like this:

Text\ Field\ A + Text\ Field\ B - Text\ Field\ C = Text\ Field\ D


Acrobate du PDF, InDesigner et Photoshopographe
Translate
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