PDF Editing Issues

Make a PDF Text Field Required When a Checkbox Is Selected in Adobe Acrobat

Steven ParkerSteven Parker Nov 19, 2026 869 views

Question details

Make a PDF text field required only when a specified checkbox is selected, including when another script changes the checkbox.

Make a PDF Text Field Required When a Checkbox Is Selected in Adobe Acrobat
Product
Adobe Acrobat PDF forms
Device & OS
not provided
Scenario
A PDF form uses a JavaScript toggle to change a checkbox, and a related text field should be required when that checkbox is selected.
Observed behavior
The text field's required status should follow the checkbox value automatically.
Before you start

Open the PDF in an Acrobat edition that supports form editing and JavaScript. In Prepare a Form, confirm the exact names of the checkbox and text field, and check that form calculations are enabled in Acrobat's Forms preferences.

Solution 1Recommended

Add a Conditional Required Calculation Script to the Text Field

Use this method when the text field's required status should follow the checkbox value.

1
Open the form editor

Open the PDF in Adobe Acrobat and select All tools > Prepare a form. Locate the checkbox and the text field.

2
Check the checkbox name

Open the checkbox's Properties and check its name on the General tab. The example script uses "Check Box12"; replace it with your checkbox's exact name if different.

3
Add the calculation script

Open the text field's Properties, select the Calculate tab, and choose Custom calculation script > Edit. Enter: event.target.required = this.getField("Check Box12").value == "Off" ? false : true;

4
Test both checkbox states

Close the field properties and use Preview to select and clear the checkbox. Also run the existing toggle action and check that the text field becomes required only when the checkbox is selected.

5
Recalculate if needed

If a programmatic toggle does not update the text field immediately, add this.calculateNow(); after the checkbox value change in the toggle script, then test again.

Add a Conditional Required Calculation Script to the Text Field
Check viewer compatibility: The script treats "Off" as unchecked and any other value as checked. PDF viewers vary in their support for Acrobat JavaScript and required-field validation, so test the form in the viewer recipients will use.
Free Microsoft Office alternative

Edit and Review PDF Documents with WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Microsoft Office files, making it easy to move between document formats. Use Acrobat or another compatible form editor for the conditional JavaScript setup described above.

Open and review PDF forms alongside other documentsCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for an easier transition from Microsoft OfficeFree, lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Where should I put the conditional required script?

In Acrobat's Prepare a form tool, open the text field's Properties and select Calculate > Custom calculation script > Edit. The script updates the text field through event.target.

What if my checkbox has a different name?

Check its name under checkbox Properties > General, then replace "Check Box12" in this.getField("Check Box12") with that exact name.

Why doesn't the required status change when another script toggles the checkbox?

Check Acrobat's Forms preferences to ensure automatic field calculations are enabled. If the update still does not occur immediately, call this.calculateNow(); after changing the checkbox value in the toggle script.

Will every PDF viewer enforce the required field?

No. Viewers differ in their support for PDF JavaScript and form validation. Test the checkbox and form submission in the intended viewer; the required property does not necessarily prevent saving an incomplete PDF.