Skip to main content
derrekh87403922
New Participant
July 13, 2018
Question

How to sum 2 text fields with data from data tags...

  • July 13, 2018
  • 2 replies
  • 2040 views

I am working on a pdf form in adobe acrobat that will merge with another program (Service Monster).  This is accomplished by adding data tags such as [LINE_QTY_3] into the properties name box of a given text form field in acrobat, which then pulls in the quantity from line 3 of the other program. The problem I am having is I want to add together the value from 2 text fields that contain data that was pulled in through these data tags.  In particular, I want to sum [LINE_QTY_3] & [LINE_QTY_4]. Any ideas on how to accomplish this?

This topic has been closed for replies.

2 replies

Inspiring
July 15, 2018
derrekh87403922
New Participant
July 16, 2018

I tried entering the following into the text field properties->Calculate->Custom Calculation Script:

event.value = ( this.getField("[LINE_QTY_3]").value + this.getField("[LINE_QTY_4]").value )

It doesn't work.  Do to values of each field need to be converted into numbers before they can be added?

try67
Community Expert
July 16, 2018

That's a good idea, yes.

Inspiring
July 14, 2018

Your question is not clear. PDF have many types of text objects and tags.

Are asking about form fields or accessibility tags?

Acrobat JavaScript can only access form fields.

derrekh87403922
New Participant
July 16, 2018

Form fields...

try67
Community Expert
July 16, 2018

Use the built-in Sum function under the Calculate tab of the field where you want to show the result and select those two fields from the list.