Skip to main content
Henry.Ong
Inspiring
Jun 20, 2025 5:22 PM UTC
Question

How to clear certain fields in Acrobat

I have created a fillable PDF with several input fields. What I want to happen is to create a functional button that will clear a field located on a certain page.

 

This is the script I used, but I am having a Syntax Error: missing ) after argument list1: at line 2.

 

var alert = app.alert("("This action will clear selected fields on this page.\nDo you want to continue?"",0,2);
if(alert == 4){
this.resetForm("FIELD1");
}

2 replies

Participant
Jun 20, 2025 5:31 PM UTC

The syntax error is from the quotation marks in your app.alert line. Try this version instead:

var alert = app.alert("This action will clear selected fields on this page.\nDo you want to continue?", 0, 2);
if (alert == 4) {
    this.resetForm(["FIELD1"]);
}

Make sure the field name is exact. Also, resetForm expects an array of field names, even if it’s just one

Translate
try67
Community Expert
Community Expert
Jun 20, 2025 6:12 PM UTC

It's true about resetForm expecting an array, but it will also work with a string as the input.

Translate