How to Clear Image Fields with a PDF Form Reset Button in Acrobat
Question details
The user needs a way to clear all entered text and dynamically assigned images simultaneously using a single reset button in a PDF form.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Filling out daily inspection reports requiring both text data and photo attachments within a PDF form.
- Observed behavior
- The standard PDF "Clear Form" action removes entered text but fails to remove photos or JavaScript image icons added to the document.
Ensure you have Adobe Acrobat Pro or a comparable advanced PDF editor that supports form preparation and custom JavaScript execution. Take note of the exact field names for all the image fields you intend to clear.
Use Custom JavaScript to Clear Both Text and Image Fields
Replace the default reset action with a custom JavaScript snippet that systematically clears text data while explicitly removing the assigned icons or values from image fields.
The standard 'Reset a Form' action in the PDF specification is designed for standard data fields like text boxes and checkboxes. Because dynamically added images often function as button appearances (icons) rather than standard field values, they must be cleared explicitly using JavaScript.
Open your document in Adobe Acrobat Pro, go to the 'Tools' menu, and select 'Prepare Form' to enter editing mode.
Right-click your existing Reset button and select 'Properties'. Navigate to the 'Actions' tab.
In the Actions list, locate the 'Reset a form' action. Select it and click the 'Delete' button to remove the default behavior.
Under 'Select Action', choose 'Run a JavaScript' from the dropdown menu and click 'Add'.
In the JavaScript Editor, type `this.resetForm();` to clear standard text fields. Then, add the explicit image clearing code for each image field. For example, if your image field is a button named 'Image1', add `this.getField("Image1").buttonSetIcon(null);`. Click 'OK' to save and test your form.

Manage and Edit PDF Forms Easily with WPS Office
If you frequently work with interactive PDF forms, WPS Office provides a robust PDF Editor that simplifies filling, editing, and managing form data without requiring complex configurations.
- 1. Open Your Form in WPS PDF: Launch WPS Office and open your interactive PDF inspection report or form.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to view all available form filling and editing controls.
- 3. Fill or Clear Data: Use the provided form tools to input text, upload necessary images, or reset standard form fields cleanly.
- 4. Save the Template: Save your empty or refreshed PDF as a clean template document for future daily inspection reports.

Frequently Asked Questions
Why does the standard Reset Form button ignore my images?
The default 'Reset a form' action only targets traditional input data (like text, dropdowns, and checkboxes). Dynamically inserted images are often treated as button appearances (icons) rather than standard input values, which falls outside the scope of a basic reset command.
How do I find the exact name of my image field to use in the script?
In your PDF editor's form preparation mode, double-click the image field to open its Properties dialog. The exact, case-sensitive field name will be displayed at the top of the 'General' tab.
Can I reset only specific fields instead of clearing the entire form?
Yes. If using a standard reset action, you can selectively choose which fields to clear. If using JavaScript, you can omit the `this.resetForm();` command and instead individually reset fields using `this.getField("FieldName").value = "";` for text or `buttonSetIcon(null)` for images.




