PDF Editing Issues

Make Two PDF Form Fields Mutually Exclusive in Adobe Acrobat

John WilsonJohn Wilson Nov 19, 2026 868 views

Question details

Make two corresponding PDF form fields mutually exclusive so that entering a value in either field prevents editing the other.

Make Two PDF Form Fields Mutually Exclusive in Adobe Acrobat
Product
Fillable PDF form
Device & OS
not provided
Scenario
A fillable PDF has paired fields in Column A and Column B, and users should enter a value in only one field in each pair.
Observed behavior
Entering a value in one field should make its paired field read-only; clearing the value should make the paired field editable again.
Before you start

Open the fillable PDF in a form editor that supports field-level JavaScript, such as Adobe Acrobat Pro, and check the exact names of both fields. For each pair, start with both fields empty and editable.

Solution 1Recommended

Add validation scripts to both fields in Adobe Acrobat

Use this method to make each field control whether its paired field is editable.

Each validation script checks the value being committed and changes the paired field's read-only property. The change generally takes effect when the user leaves the field or otherwise commits the entry.

1
Open the form editor

In Adobe Acrobat Pro, open the PDF and select Prepare a form. Identify the exact field names for the pair you want to control.

2
Add the first validation script

Open field A's Properties, select the Validate tab, and choose Run custom validation script. Select Edit and enter: this.getField("B").readonly = event.value == "" ? false : true;

3
Add the second validation script

Open field B's Properties, select the Validate tab, and choose Run custom validation script. Select Edit and enter: this.getField("A").readonly = event.value == "" ? false : true;

4
Replace field names and save

In each script, replace A or B inside getField with the exact name of the opposite field. Repeat for any other pairs using their respective field names, then save the PDF.

5
Test both directions

Open the saved PDF in Adobe Acrobat or Acrobat Reader. Enter a value in the first field and move focus away; confirm the second field is read-only. Clear the first field and move focus away, then repeat the test starting with the second field.

Add validation scripts to both fields in Adobe Acrobat
Viewer support matters: The scripts require a PDF viewer that supports and allows Acrobat form JavaScript. Some browser-based and other PDF viewers may not apply the read-only behavior.
Free Microsoft Office alternative

Work with PDF and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Its Microsoft Office format support makes it easy to move existing files into WPS. Use a PDF editor that supports Acrobat form validation JavaScript for the conditional field behavior described above.

Open and review PDF documents alongside your Office filesWork with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface to transition from Microsoft OfficeGet a lightweight office suite with free tools
QA img-9

Frequently Asked Questions

Where can I find the exact names of the PDF form fields?

In Adobe Acrobat Pro, open Prepare a form and inspect the fields in the form editor. Open a field's Properties to check its name, then use that exact name in the other field's getField call.

When does the other field become read-only?

The validation script runs when the entry is committed, typically when the user moves focus away from the field. Clearing the value and committing the change makes the paired field editable again.

Can I use the same scripts for multiple rows?

Yes. Add the scripts to each pair and replace the names inside getField with the exact name of the opposite field in that row. Each pair needs its own corresponding field names.

Why does the form work in Acrobat but not in my browser?

Some browser PDF viewers do not support or allow Acrobat form JavaScript. Test the saved form in Adobe Acrobat or Acrobat Reader with JavaScript enabled.