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

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

New Here ,
Jul 13, 2018 Jul 13, 2018

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?

TOPICS
Acrobat SDK and JavaScript , Windows
2.0K
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
LEGEND ,
Jul 14, 2018 Jul 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.

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
New Here ,
Jul 16, 2018 Jul 16, 2018

Form fields...

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 ,
Jul 16, 2018 Jul 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.

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
New Here ,
Jul 16, 2018 Jul 16, 2018

I tried that, but it won't let me select any of the boxes next to the fields, I can only select all.

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 ,
Jul 16, 2018 Jul 16, 2018

Use the space-bar or click a bit off to the center of each check-box.

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
New Here ,
Jul 16, 2018 Jul 16, 2018
LATEST

highlighting and hitting the space bar worked for selecting.  Which is a bit of progress.  Now I get a $0.00 instead of a blank field.  But it's still not adding the values from the 2 form fields.  Is there a way to make it so it doesn't sum the fields until after the fields populate the data that it gets through the data tags?  Like have the pdf fill form fields in a certain order?

Or any other ideas?

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
LEGEND ,
Jul 15, 2018 Jul 15, 2018
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
New Here ,
Jul 16, 2018 Jul 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?

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 ,
Jul 16, 2018 Jul 16, 2018

That's a good idea, yes.

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