Skip to main content
Inspiring
February 18, 2024
Answered

Problems with programming form including calculations

  • February 18, 2024
  • 1 reply
  • 1148 views

I am putting together a form that will be fillable and saved using Acrobat Reader. It is also going to have some simple calculations. First problem is in the process of naming the fields and taking the spaces from between words out, when I tab to rename the tool tip to match the field name the program changes to another field in the form. The second problem is the totalling of dollar amount to the Amount field. I have formatted it to show 2 decimal places and have $ sign for currency. When I select the Amount field and go to Calculate and select sum + and pick all the fields to be added together and then select Close, the program says I don't have a field named Gold$32 and I don't. The correct field name is in my screen shot I am attaching showing all fields. Any help would be greatly appreciated. Thanks

This topic has been closed for replies.
Correct answer Thom Parker

The built-in "Sum" calculation uses a script to parse the fields and perform the calculation. This script is very sensitive to field names. I would suggest removeing special characters (punctuation) and spaces from all field names that are used in the calculation.  It is the "," that is causing the issue. 

I would further suggest removing all field formatting until the calculations, and all other interactivity is working properly.  Formatting should be the last thing that is applied to the fields, after you know it's working correctly. 

 

 

 

1 reply

Thom Parker
Thom ParkerCorrect answer
Community Expert
February 18, 2024

The built-in "Sum" calculation uses a script to parse the fields and perform the calculation. This script is very sensitive to field names. I would suggest removeing special characters (punctuation) and spaces from all field names that are used in the calculation.  It is the "," that is causing the issue. 

I would further suggest removing all field formatting until the calculations, and all other interactivity is working properly.  Formatting should be the last thing that is applied to the fields, after you know it's working correctly. 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
jodmcc49Author
Inspiring
February 19, 2024

Thanks Thom,

Would those characters also cause the fields to change when tabbing to the tool tips? Once everything is working correctly and it is saved as an extended PDF, the person will be able to download, fill and save and then attach it to an email. Is that correct?

Thanks, John 

Thom Parker
Community Expert
February 19, 2024

Yes, that is correct, but I don't think you need to save it as extended. Many of the rights that are provided by the Reader Extension are now built-into Reader. 

I do not believe those special characters would have any affect on tabbing to the tooltips. 

 

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