PDF Editing Issues

Replace the Off Checkbox Value in an Adobe Acrobat Form Script

Jason MillerJason Miller Nov 18, 2026 870 views

Question details

Prevent an unchecked checkbox value from appearing as Off in a calculated text field.

Replace the Off Checkbox Value in an Adobe Acrobat Form Script
Product
Adobe Acrobat PDF forms
Device & OS
not provided
Scenario
A form calculation combines a checkbox value with other text and should use an alternative value when the checkbox is unchecked.
Observed behavior
The calculated text field displays Off because the script includes the value of an unchecked checkbox.
Before you start

Open the PDF in Acrobat and identify the checkbox, the alternative-value field, and the calculated text field. Confirm their exact field names in Prepare a form before editing the calculation script.

Solution 1Recommended

Substitute another value in the Acrobat calculation script

Use this approach when an unchecked checkbox should contribute a different field value instead of Off.

An unchecked Acrobat checkbox returns Off. Rather than changing that default value, test for it and use a substitute when building the calculated text.

1
Open the calculated field

In Acrobat, open All tools > Prepare a form, then double-click the calculated text field to open its properties.

2
Edit the calculation script

On the Calculate tab, select Custom calculation script and click Edit. In the existing script, read the fields as strings and choose the replacement: var s5 = this.getField("3E1.1(b)").valueAsString; var s6 = this.getField("Hidden").valueAsString; var x = (s5 === "Off") ? s6 : s5;

3
Use the substitute in the output

In the existing expression that builds the text assigned to event.value, replace the occurrence of s5 with x. Keep the rest of the expression intact, and replace the example field names with your actual field names if they differ.

4
Test both checkbox states

Confirm the script changes, close the field properties, and use Preview in Prepare a form. Check and uncheck the box to verify that the calculated field shows the checkbox value when checked and the Hidden field value when unchecked.

Substitute another value in the Acrobat calculation script
To show nothing instead: Use an empty string as the substitute: var x = (s5 === "Off") ? "" : s5;
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office files. Its format compatibility helps you move existing documents into your workflow, though it does not replace the Acrobat JavaScript fix above.

Open PDF documents alongside your other office filesCompatible with Microsoft Office formats such as DOCX, XLSX, and PPTXFamiliar interface for an easier transitionFree and lightweight for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Why does my calculated field show Off?

An unchecked Acrobat checkbox returns Off. If your calculation concatenates that value into a text string, Off appears in the calculated field.

Can I change the default Off value of an unchecked checkbox?

No. Instead, check for Off in the calculation script and substitute an empty string or another field's value before building the output.

Where do I edit the calculated field's script?

In Acrobat, open All tools > Prepare a form, double-click the calculated text field, and select Calculate > Custom calculation script > Edit.

How do I leave the output blank when the checkbox is unchecked?

Read the checkbox value as a string and use an empty string for Off, for example: var x = (s5 === "Off") ? "" : s5;. Use x in the output expression.