How to Create Form Field Calculations
It may come off like a broken record to point out that these days the paper version of documents (like forms) are fading away. This actually makes life way simpler in many cases. Instead of receiving files full of bad math, you could learn how to create form field calculations.
You may wonder what we mean when we say, “create form field calculations”. When you are creating your form, in a good PDF editor, you can create relationships between these form fields. With a little bit of configuration, you can create form fields that calculate data that will make filling out your forms a breeze.
Soda PDF is an app, which provides all the functionality you need, to make forms that include dynamic calculations.
On that note, let’s get to it.
Step 1 – Adding a Text Form Field
You’ll need to use text form fields when you create form field calculations. You’ll need at least three text fields in your document to perform a calculation.
- Open the Forms Tab.
- Choose Text Field.
- Move your mouse cursor into your document.
- Hold down the left mouse button and drag the mouse.
- You’ll see the outline of your form field adapt as you move your cursor.
- Release the mouse button.
If this form field is the perfect size, you can easily copy and paste it to add more fields to your document.
- Click into Edit Mode.
- Right-click on the field and choose Copy.
- Then right-click anywhere and choose Paste.
In the Properties section you can configure the aesthetic of your form field, but in this article, we’ll focus on how calculations work.
Step 2- Name your form fields
Every form field has its own name that is used to make sure that the data is tracked correctly. When you create form field calculations, you’ll need these field names to make sure any relationships between them are set up correctly.
It’s very easy to check the name, and even change it to something custom.
- While in Edit Mode select your field.
- Click on the Properties tab.
Your field name will be found here:
You can easily update the name.
- Click into the name field.
- Type in your new name.
- Press the Enter key on the keyboard to confirm.
We recommend you name each field in a way that makes it quick and easy to recognize later on.
Step 3- Configure your field type
When you create form field calculations, a good rule of thumb is to format the field to make sure a user enters the information you need. You can restrict a field to only accept numbers or format the field to be a specialized number like a date.
- Choose the Format
- Click on the option next to Category.
- Choose one from the list.
- For this example, we’ll choose Number.
You can configure the following options.
Decimal Places – Click here to change how many numbers will appear after the decimal place in a number. For example, if you set it to 4, you’ll see numbers appear like 3.0001.
Separator Style – Some locations prefer commas, others prefer periods. In this option you can customize your number style.
Currency Symbol – Money is a key thing that gets calculated in forms. You can set any currency symbol you’d like to use.
We advise that each field involved in your calculation be configured in the same way, so that there are no future formatting surprise.
Step 4 – Setting up your calculations – Quick n’ Easy method
When you create form field calculations you will configure the field that will display the results of this calculation. You’ll establish which fields it interacts with and what kind of calculation you’d like to perform.
There is a very quick way to set up a calculation.
- In the Properties open the Calculations
- Next to Category choose Predefined from the list.
Next to Predefined, you can choose the calculation you want to use.
- Click the dropdown.
- Choose one from the list.
Then, you’ll pick the fields you want to calculate.
- Click Select next to Fields.
- Check the boxes next to the field.
- Click OK
Now it’s time to test everything works.
- Head into View Mode.
- Click into the relevant fields and enter numbers.
You’ll see the calculation automatically appear in the answer field.
Step 5 – Setting up your calculations – Multiple Calculations
You can have more control, so we’ll show you how to create field calculations beyond the predefined options.
- Choose Simplified field notation next to Category.
- A box will appear where you can enter your math equation.
- Following the order of operations, you can create equations. Enter each field name (make sure all capitalization matches) and separate the field names with the correct math symbol.
- As an example: to perform division it would be field1/field 2.
- Another example can set it up like field1/field2+field3*field4 and in this case it will add the product of field 3 & 4 with the results of dividing field 1 by field 2.
- Click OK when you are ready to proceed.
You can again test this by entering numbers while in View Mode.
- Choose Custom calculation script next to Category.
- Then click Set next to Script.
- Enter your code into the box.
- Click OK.
We encourage you to download Soda PDF now that you know how to create form field calculations. Test out the free trial and let us know what kind of forms you made.