How to Increase a PDF Form Field Value by 20 Percent
Question details
The user needs to automatically add a 20 percent tax to an entered fabrication price within a PDF form field.

- Product
- Device & OS
- not provided
- Scenario
- Setting up a PDF inspection form that requires automatic tax calculation on a manually entered price value.
- Observed behavior
- The form needs to take an entered base value (e.g., 100) and automatically output the final total with a 20% tax included (e.g., 120).
Ensure you have access to advanced PDF form editing tools and JavaScript editing features in your PDF software before proceeding.
Use a Custom Validation Script for Automatic Calculation
Apply a simple JavaScript validation script to the form field to automatically multiply the entered value by 1.2.
By using a custom validation script, the PDF form will automatically intercept the value entered by the user, multiply it by the desired percentage, and display the final total in the same field.
Open the PDF document in prepare form mode, right-click the target text field, and select 'Properties'.
In the Text Field Properties dialog box, click on the 'Validate' tab.
Select the 'Run custom validation script' option and click the 'Edit' button.
Input the following JavaScript code: if (event.value) event.value = Number(event.value) * 1.2; and click 'OK' to save.

Use Separate Fields for Price, Tax, and Total
Instead of overwriting the entered value, use distinct fields to display the original price, the calculated tax, and the final total for better data clarity.
Create and Manage PDF Forms Easily with WPS Office
WPS Office features a powerful PDF editor that allows you to easily create, edit, and manage interactive PDF forms, including custom field calculations and scripts.
- 1. Open PDF in WPS Office: Launch WPS Office and open your PDF form document.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to access the interactive form creation tools.
- 3. Edit Field Properties: Double-click any form field to open its properties menu and configure calculations or validation scripts.
- 4. Save and Distribute: Save your document. The interactive calculations will function smoothly for anyone filling out the form.

Frequently Asked Questions
Why is my PDF form calculation showing the wrong total?
This is typically caused by an incorrect calculation order. To fix this, open your form editing tools, navigate to the calculation order settings, and ensure the fields calculate in the logical sequence (e.g., Price first, then Tax, then Total).
Can I perform basic calculations without using JavaScript?
Yes. In the field properties under the 'Calculate' tab, you can select 'Value is the' and choose basic operations like Sum, Product, Average, Minimum, or Maximum for selected fields without writing code.
Do PDF form calculations work on mobile devices?
Basic calculations usually work on modern mobile PDF viewers, but complex custom JavaScript validations may not be supported on default mobile apps. Users are recommended to use a dedicated PDF reader app like WPS Office on their mobile devices for full form functionality.




