Skip to main content
Henry.Ong
Inspiring
June 20, 2025
Pregunta

How to clear certain fields in Acrobat

  • June 20, 2025
  • 1 respuesta
  • 172 visualizaciones

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");
}

1 respuesta

Participant
June 20, 2025

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

try67
Community Expert
Community Expert
June 20, 2025

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