How to Display YES or NO from a Percentage in an Acrobat PDF Form
Question details
The user needs to create a conditional calculation in an Acrobat PDF form that automatically displays "YES" when a supervised hours field is 10% or more, and "NO" when it is below 10%.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form that requires conditional text output based on the evaluated value of a percentage field.
- Observed behavior
- The user needs the correct JavaScript logic and calculation script to evaluate the percentage field and output the corresponding text string.
Ensure you have Adobe Acrobat Pro or a capable PDF form editor that supports JavaScript, and verify the exact field name of your percentage field before writing the calculation script.
Add a Custom Calculation Script for Decimal Percentages
Use this method if your PDF form's percentage field stores values as decimals under the hood (for example, 0.1 for 10%).
In many PDF forms, percentage formats actually store the underlying data as a decimal. When comparing these values in JavaScript, you must compare them against the decimal equivalent (e.g., 0.1) rather than the whole number (10).
Open your PDF document in Adobe Acrobat, go to the Tools menu, and select 'Prepare Form'.
Right-click the target text field where you want the 'YES' or 'NO' result to appear and select 'Properties'.
Navigate to the 'Calculate' tab in the Properties window, choose the 'Custom calculation script' option, and click the 'Edit' button.
Type the following script: `var hours = Number(this.getField("% of Hours Supervised").valueAsString); event.value = hours >= 0.1 ? "YES" : "NO";`. Be sure to replace "% of Hours Supervised" with the exact name of your percentage field.
Click 'OK' to save the script, close the Properties dialog, and test your form by entering different percentages.

Add a Custom Calculation Script for Whole Number Percentages
Use this alternative script if your percentage field is configured to store values as whole numbers (for example, 10 for 10%).
Create and Edit Interactive PDF Forms with WPS Office
WPS Office features a robust PDF editor that allows you to fill, create, and manage interactive PDF forms effortlessly. It is a lightweight, cost-effective solution for all your daily PDF and office document tasks.
- 1. Open WPS PDF: Launch WPS Office and click on the 'PDF' tab to open the built-in PDF editor.
- 2. Navigate to Form Tools: Open your PDF document and go to the 'Form' tab on the top ribbon.
- 3. Add Form Fields: Use the provided form controls to add text fields, check boxes, or drop-down lists to make your document interactive.
- 4. Save Your Form: Fill out your required data and click 'Save' to preserve your interactive PDF form.

Frequently Asked Questions
Why is my YES/NO field not updating automatically when I change the percentage?
This usually occurs because of an incorrect calculation order in the PDF. To fix this in Acrobat, go to 'Prepare Form' mode, click 'More' (or the options menu) in the right pane, and select 'Set Field Calculation Order'. Ensure the percentage field is calculated before the YES/NO result field.
Can I leave the YES/NO field blank if the percentage field is empty?
Yes. You can modify your JavaScript to check for an empty string first. For example: `if (this.getField("Percentage").valueAsString === "") { event.value = ""; } else { /* your YES/NO logic here */ }`.
Do JavaScript custom calculations work in all PDF viewers?
No, custom calculation scripts rely on PDF JavaScript support. While they work perfectly in Adobe Acrobat, WPS PDF, and other premium desktop PDF editors, they may fail to execute in basic web browser PDF viewers or simple mobile preview apps.




