Copy link to clipboard
Copied
Hi everyone,
I’m working on an interactive PDF form in Adobe Acrobat and need to calculate percentages based on user inputs. For example, I have two fields (e.g., "Total Amount" and "Partial Amount"), and I want a third field to automatically display the percentage calculation (e.g., what percentage the partial amount is of the total).
I’ve been testing the formulas manually using www.percentagescalculator.co.uk, which has been super helpful for verification, but I’m not sure how to script this directly in Acrobat.
Does anyone have experience with setting up scripts for percentage calculations in PDF forms? Any tips or example scripts would be greatly appreciated!
Copy link to clipboard
Copied
Format the field at a percentage in the format tab of the field properties, then enter the following custom calculation script:
if(!this.getField("Total Amount").value)
{event.value=""}
else
{event.value=this.getField("Partial Amount").value/this.getField("Total Amount").value}