PDF Editing Issues

How to Display YES or NO from a Percentage in an Acrobat PDF Form

Huma Ashraf ChHuma Ashraf Ch Nov 10, 2026 868 views

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%.

How to Display YES or NO from a Percentage in an Acrobat PDF Form
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.
Before you start

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.

Solution 1Recommended

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).

1
Enter Prepare Form Mode

Open your PDF document in Adobe Acrobat, go to the Tools menu, and select 'Prepare Form'.

2
Open Field Properties

Right-click the target text field where you want the 'YES' or 'NO' result to appear and select 'Properties'.

3
Select Custom Calculation Script

Navigate to the 'Calculate' tab in the Properties window, choose the 'Custom calculation script' option, and click the 'Edit' button.

4
Enter the JavaScript Code

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.

5
Save and Test

Click 'OK' to save the script, close the Properties dialog, and test your form by entering different percentages.

Add a Custom Calculation Script for Decimal Percentages
Field Name Accuracy: JavaScript is case-sensitive. Ensure that the field name referenced in `this.getField("...")` matches your actual form field name perfectly.
Advanced PDF Form Editor

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. 1. Open WPS PDF: Launch WPS Office and click on the 'PDF' tab to open the built-in PDF editor.
  2. 2. Navigate to Form Tools: Open your PDF document and go to the 'Form' tab on the top ribbon.
  3. 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. 4. Save Your Form: Fill out your required data and click 'Save' to preserve your interactive PDF form.
Fully compatible with standard PDF forms and Adobe Acrobat formats.Easily insert text fields, checkboxes, and interactive elements into your PDFs.Lightweight, fast, and features a highly familiar user interface.All-in-one office suite supporting PDF, Word, Excel, and PowerPoint files seamlessly.
microsoft office alternative - wps office

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.