PDF Editing Issues

How to Replace Acrobat Checkbox Off Value with No or Blank using JavaScript

Aamir Naveed AkramAamir Naveed Akram Nov 2, 2026 870 views

Question details

The user needs to convert the default unchecked export value ("Off") of a PDF checkbox into a user-friendly string like "No", "Yes", or a blank field to be displayed in another form field.

How to Replace an Acrobat Checkbox's Off Value with No or a Blank Field
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating an interactive PDF form where text fields need to display specific text based on whether a checkbox is checked or unchecked.
Observed behavior
By default, an unchecked checkbox returns the system value "Off", which is not ideal for final display purposes in calculated text fields.
Before you start

Ensure your PDF editor supports JavaScript calculation scripts and identify the exact field names of both your checkbox and the target display field.

Solution 1Recommended

Use a Custom JavaScript Calculation Script

Apply a custom script to the target text field to evaluate the checkbox's state and return the desired text string dynamically.

In PDF forms, checkboxes are hardcoded to return 'Off' when unchecked. By using a ternary operator inside a custom calculation script, you can intercept this 'Off' value and output any text you prefer, such as 'No' or a completely blank space.

1
Open Field Properties

Right-click the text field where you want the resulting text to appear, and select 'Properties' from the context menu.

2
Navigate to the Calculate Tab

In the Properties dialog, go to the 'Calculate' tab. Choose 'Custom calculation script' and click the 'Edit' button.

3
Enter the Yes/No Script

Assuming your checkbox is named 'P', type the following code: event.value = "Pump: " + ((this.getField("P").value == "Off") ? "No" : "Yes");

4
Modify for a Blank Value

If you want the field to appear completely blank instead of displaying 'No' when unchecked, change the script to: event.value = "Pump: " + ((this.getField("P").value == "Off") ? "" : "Yes");

5
Save and Test

Click 'OK' to close the JavaScript editor, then close the Properties window. Toggle your checkbox in preview mode to verify that the text updates correctly.

Use a Custom JavaScript Calculation Script
Match Field Names Exactly: JavaScript is case-sensitive. Ensure you replace 'P' in the script with the exact name of your checkbox field.
WPS PDF Editor

Create and Manage Fillable PDF Forms with WPS Office

WPS PDF offers a streamlined, user-friendly interface for creating interactive forms. You can easily add checkboxes, text fields, and configure properties without relying on complex external software.

  1. 1. Open WPS PDF: Launch WPS Office and open your document using the built-in PDF editor.
  2. 2. Access Form Controls: Click on the 'Form' tab on the top ribbon to reveal interactive form options.
  3. 3. Add Checkboxes and Fields: Select the checkbox tool to insert fields and double-click them to adjust their export values and appearance.
  4. 4. Save as Standard PDF: Save your document. Your interactive form will work seamlessly across all standard PDF readers.
Intuitive form-building tools to add checkboxes, radio buttons, and text fields.Fully compatible with standard Adobe Acrobat PDF formats.Lightweight architecture ensures smooth editing even on large PDF forms.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my PDF checkbox default to 'Off'?

According to the standard PDF form specification, an unchecked checkbox always returns the export value 'Off'. This ensures the PDF reader software can easily distinguish between checked and unchecked states.

Can I change the default 'Off' value natively without using JavaScript?

No, the 'Off' state is hardcoded into the PDF format standard for unchecked boxes. To display a different text value, you must use a calculation script to interpret the 'Off' value dynamically.

How do I find the exact field name for my script?

Right-click the target form field in your PDF editor's Prepare Form mode, select Properties, and check the 'Name' field under the General tab. Use this exact name inside the this.getField() parameter.