Skip to main content
Participant
Oct 20, 2017 5:18 PM UTC
Question

Total noob needing starting point

I consider myself computer savvy and I can generally pick up on things real quick, but this JavaScript is giving me a headache.  I have Acrobat DC and have created a couple simple forms so far.  The simple calculations are easy enough, but now I must delve into the more complicated scripting calculations and I just don't understand where to start.  I've read all sorts of blogs and forums, studies the instructions provided by adobe and i seem more confused. 

In the example form shown below, I want to have an employee enter a few fields and have the form calculate the rest as specified below:

1. Column "Pay Date" PaymentD_1 should equal Repayment_Start_Date as entered by the employee.

2. The rest of the PaymentD_xx should be PaymentD_1 + 14 days so that it is every two weeks.

3. Total_Due needs to be Amount, plus sales tax if the Sales_Tax_Included box is unchecked, otherwise it equals Amount.

4. Column "Amount" would be Total_Due divided by 13.

5. Column "Balance" would be (obviously) Total_Due minus PaymentA_xx.

6. Finally, I want each Signature box to send the completed form to certain email(s). 

I am looking for direction, not a written script.  I want to learn how to write this so that I can continue in the future.  Any help you can provide will be greatly appreciated.  Thanks in advance.

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Thom Parker
Community Expert
Community Expert
Oct 21, 2017 7:59 PM UTC

Google these items for articles and tutorials on the topics you need.

Working with date and time in Acrobat JavaScript

calculation scripts for acrobat

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Hillary MAuthor
Participant
Oct 20, 2017 5:22 PM UTC

I'm thinking I will need to add a field for number of payments requesting because not every employee wants 13 payments...sometimes it's only 3 or 4.  But I'm sure adding that in will be fine once I get started and I know it will just be part of a division calculation.

Translate
Inspiring
Oct 21, 2017 5:39 PM UTC

Many of the main pages in these forums have links to tutorials and training pages posted by Adobe. Date calculations are probably to advance for a first project.

Translate