PDF Editing Issues

How to Remove a Required Field Border After Text is Entered in PDF Forms

Aamir Naveed AkramAamir Naveed Akram Nov 3, 2026 868 views

Question details

The user needs to make a conditionally required Acrobat form field stop appearing incomplete (displaying a required border) immediately after text is entered.

How to Remove a Required Field Border After Text is Entered in PDF Forms
Product
PDF Forms
Device & OS
not provided
Scenario
Creating or editing a fillable PDF form where specific text fields are marked as required but should visually update once filled.
Observed behavior
The form field retains its 'required' visual indicator (such as a red border) even after the user has typed text into it.
Before you start

Ensure you have access to a professional PDF editor that supports JavaScript for forms, such as Adobe Acrobat Pro, and that you have form-editing permissions for the document.

Solution 1Recommended

Use a Custom Validation Script to Toggle the Required Status

Apply a short JavaScript code to the field's validation settings to automatically remove the required status (and its border) once text is entered.

When a field is set as required in a PDF form, it typically displays a distinct colored border to alert the user. By using a custom validation script, you can dynamically change the field from required to optional the moment a user inputs text, effectively removing the border.

1
Open Form Editing Mode

Open your PDF form in your PDF editor (like Adobe Acrobat) and enter 'Prepare Form' mode from the Tools menu.

2
Access Field Properties

Right-click the specific required text field you want to modify and select 'Properties' from the context menu.

3
Add Validation Script

Navigate to the 'Validate' tab in the Properties dialog box and select the 'Run custom validation script' option.

4
Enter the JavaScript Code

Click the 'Edit' button and paste the following code: event.target.required = (event.value.length == 0); then click 'OK'.

5
Save and Test

Close the Properties dialog and exit form editing mode. Type text into the field to verify that the required border disappears automatically.

Use a Custom Validation Script to Toggle the Required Status
Immediate Visual Feedback: For a more immediate visual update while the user is actively typing (rather than waiting until they click away from the field), you can apply similar logic under the 'Format' tab using a custom keystroke script.
Edit PDF Forms Easily

Create and Manage Fillable PDF Forms with WPS Office

WPS Office provides a comprehensive built-in PDF editor that allows you to easily create, edit, and manage fillable PDF forms. You can seamlessly add text fields, checkboxes, and modify form properties with a highly intuitive user interface.

  1. 1. Open Your PDF in WPS Office: Launch WPS Office and open your existing PDF document using the built-in PDF editor.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to view all available form creation and editing tools.
  3. 3. Edit Field Properties: Double-click any form field to open its properties panel, where you can quickly adjust its appearance, formatting, and set it as required or optional.
Easily edit PDF text, images, and form fields in a unified, lightweight workspace.Highly compatible with standard PDF formats and Adobe Acrobat fillable forms.Cost-effective solution with a familiar, easy-to-navigate interface for quick edits.Cross-platform support allowing you to manage PDFs on Windows, Mac, Linux, iOS, and Android.
QA img-9

Frequently Asked Questions

Why does my PDF form field stay red after typing?

By default, a field marked as 'Required' in form properties retains its required formatting (like a red border) until the form is submitted or validated. Using a custom validation script allows the field to dynamically update its appearance as soon as it contains text.

Can I apply this validation script to multiple fields at once?

Yes, you can select multiple fields in form editing mode, right-click to access their shared Properties, and paste the JavaScript code into the Validate tab. The script uses 'event.target', which will dynamically apply to whichever field triggers it without needing to change field names.

Does WPS Office support creating required form fields?

Yes, WPS Office's PDF editor features comprehensive form tools. You can create fillable forms, insert text fields, checkboxes, or dropdowns, and set specific fields as 'Required' through the field properties menu.