PDF Editing Issues

How to Make a PDF Form Field Fillable Only After Another is Completed

Khadija KhanKhadija Khan Nov 5, 2026 871 views

Question details

The user wants to configure a PDF form so that a specific field remains unfillable or invisible until the user completes a preceding field.

How to Make a PDF Form Field Fillable Only After Another is Completed
Product
Adobe Acrobat / PDF Editor
Device & OS
not provided
Scenario
Creating dynamic and interactive PDF forms that require users to enter information in a specific sequence.
Observed behavior
Currently, all form fields are active and visible at once, but the goal is to enforce sequential data entry by locking or hiding dependent fields using JavaScript.
Before you start

Ensure you have a PDF editor that supports form field properties and JavaScript validation. Take note of the exact internal names of both the trigger field (e.g., Field1) and the dependent field (e.g., Field2).

Solution 1Recommended

Use JavaScript to Make the Dependent Field Read-Only

Add a custom validation script to the first field that automatically toggles the read-only status of the second field based on whether the first field contains data.

By applying a validation script to the trigger field, the script will run every time the user enters or changes data in that field. It is crucial to manually set the initial state of the dependent field to Read-Only so the form is correct upon opening.

1
Open Field Properties

Right-click the first form field (the trigger field) and select 'Properties' from the context menu.

2
Add a Custom Validation Script

Navigate to the 'Validate' tab. Select the option for 'Run custom validation script' and click the 'Edit' button.

3
Enter the JavaScript Code

Type the following script to control the second field's read-only state: this.getField('field2').readonly = event.value == '' ? true : false;

4
Set the Initial Form State

Before distributing the document, right-click the second field, go to Properties, and manually check the 'Read-Only' box under the General tab.

Use JavaScript to Make the Dependent Field Read-Only
Match Field Names Exactly: Ensure that 'field2' in the script perfectly matches the actual name of your dependent field. JavaScript is case-sensitive.
Powerful PDF Editor

Edit and Manage PDF Forms Easily with WPS Office

WPS Office provides a comprehensive PDF editor that allows you to create, edit, fill, and manage PDF forms effortlessly. Whether you are filling out complex applications or designing your own interactive documents, WPS PDF handles it perfectly.

  1. 1. Open your PDF form: Launch WPS Office and open your PDF document using the WPS PDF tool.
  2. 2. Access form features: Navigate to the 'Form' tab on the top ribbon to view all interactive form field tools.
  3. 3. Edit and fill fields: Click on text fields, checkboxes, or radio buttons to fill in your data seamlessly.
  4. 4. Save and share: Once completed, click 'Save' to preserve your form data and securely share it with others.
Easily fill interactive PDF forms without compatibility issuesHighly compatible with standard PDF documents and Adobe Acrobat filesLightweight application with a fast, user-friendly interfaceIncludes comprehensive Word, Excel, and PowerPoint editing tools in one suite
microsoft office alternative - wps office

Frequently Asked Questions

Why is the second field not updating immediately after I type in the first field?

Validation scripts in PDF forms are triggered when the field data is committed. You must press 'Enter' or click outside the first field to trigger the script and update the second field.

Can I apply this conditional JavaScript to checkboxes or dropdown menus?

Yes. You can modify the script to check for a specific value rather than just an empty string. For example, you can check if a dropdown's event.value equals a specific selection to trigger the visibility of the next field.

Do I have to manually set the initial state of the dependent field every time?

Yes, you only need to do this once during the form creation process. Because the validation script only runs when the first field is modified by a user, setting the initial state to read-only or hidden ensures the form behaves correctly when it is first opened.