How to Reset PDF Form Fields for Custom Text Entry
Question details
The user needs to configure a PDF form so that selecting a 'Custom' option in a dropdown automatically resets specific text fields and allows manual text entry without the text fields clearing themselves afterward.

- Product
- PDF Forms
- Device & OS
- not provided
- Scenario
- Creating or editing an interactive PDF form with dynamic dropdowns and dependent text fields.
- Observed behavior
- Text fields keep erasing newly entered text because the reset script is firing every time the text field loses focus, instead of only when the dropdown selection changes.
Ensure your PDF editing software is in form-editing or prepare-form mode, and keep a backup copy of your PDF before modifying any field action scripts.
Move the Reset Script to the Dropdown Field Action
Changing the trigger for the reset script prevents it from firing repeatedly when editing text fields.
If a reset script runs whenever a text field loses focus, it will erase any newly entered custom text. To fix this, the script must be relocated so it only triggers when the dropdown value actually changes.
Right-click the text field that keeps erasing, select Properties, and go to the Actions or Calculate tabs. Delete any resetForm scripts located in the 'On Blur', 'Exit', or validation actions.
Right-click your dropdown field, select Properties, and navigate to the Actions tab.
Select 'Mouse Up' or 'On Blur' (selection change) from the trigger list. Click 'Add' to insert your resetForm JavaScript code here.
Ensure your code uses the appropriate pattern, such as this.resetForm(["YourTextFieldName"]); to only reset the specific target fields when 'Custom' is selected.

Verify Text Field Read-Only Settings
Ensuring the target text fields are not locked, allowing users to input custom text.
Manage and Edit Interactive PDF Forms with WPS Office
WPS PDF offers a comprehensive suite of tools for filling, editing, and managing interactive PDF forms. You can easily modify form fields, add text, and ensure seamless data entry without complex scripting or expensive software.
- 1. Open WPS PDF: Launch WPS Office and open your interactive PDF document using the WPS PDF tool.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to view all interactive form editing and filling options.
- 3. Interact with Fields: Click directly into text fields or dropdowns to test functionality, select options, and input custom text seamlessly.
- 4. Save Document: Once your form fields are filled correctly, click the 'Save' icon to preserve the interactive elements and your inputted data.

Frequently Asked Questions
Why does my PDF text field clear when I click away?
This usually happens if a script (like resetForm) is mistakenly assigned to the text field's 'On Blur', 'Calculate', or 'Exit' action. You must remove this script from the text field and place it on the dropdown or button that is supposed to trigger the reset.
How do I make a PDF form field editable after selecting a dropdown option?
Ensure the target text field does not have the 'Read Only' box checked in its properties. If it needs to be locked initially, you can use JavaScript in the dropdown's action to toggle the read-only state to false (e.g., this.getField("FieldName").readonly = false;) when 'Custom' is selected.
What is the correct JavaScript pattern to reset specific fields in a PDF?
Use the this.resetForm(["FieldName1", "FieldName2"]); method within the trigger field's action tab. Providing an array of specific field names ensures only those fields are reset, leaving the rest of the form intact.
Can I use WPS Office to fill out interactive PDF forms?
Yes, WPS Office provides robust support for interactive PDF forms. You can easily click into text fields, select dropdown options, and fill out forms exactly as intended without needing additional premium software.




