PDF Editing Issues

How to Clear Image Fields with a PDF Form Reset Button in Acrobat

Huma Ashraf ChHuma Ashraf Ch Oct 28, 2026 869 views

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.

How to Clear Image Fields with an Acrobat PDF Form Reset Button
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter Form Preparation Mode

Open your document in Adobe Acrobat Pro, go to the 'Tools' menu, and select 'Prepare Form' to enter editing mode.

2
Edit the Reset Button Properties

Right-click your existing Reset button and select 'Properties'. Navigate to the 'Actions' tab.

3
Remove the Standard Reset Action

In the Actions list, locate the 'Reset a form' action. Select it and click the 'Delete' button to remove the default behavior.

4
Add a Run JavaScript Action

Under 'Select Action', choose 'Run a JavaScript' from the dropdown menu and click 'Add'.

5
Input the Reset Code

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.

Use Custom JavaScript to Clear Both Text and Image Fields
Field Names Must Match Exactly: JavaScript is case-sensitive. Ensure that the field names enclosed in quotes within your script perfectly match the actual names of the image fields in your PDF.
Advanced PDF Form Tool

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. 1. Open Your Form in WPS PDF: Launch WPS Office and open your interactive PDF inspection report or form.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to view all available form filling and editing controls.
  3. 3. Fill or Clear Data: Use the provided form tools to input text, upload necessary images, or reset standard form fields cleanly.
  4. 4. Save the Template: Save your empty or refreshed PDF as a clean template document for future daily inspection reports.
Fully compatible with standard Adobe PDF forms and Microsoft Office document formatsEasily fill, sign, and reset interactive PDF form fieldsLightweight, fast, and features an intuitive tabbed interfaceCross-platform support allowing you to manage forms on Windows, Mac, iOS, and Android
microsoft office alternative - wps office

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.