Hi,

New Here ,
Jun 30, 2019

Copy link to clipboard

Copied

Kindly answer the code to find empty fields only in current page out of many page in PDF..

The below code works well for all page. But i require only for current page which i'm using at that time.

var emptyFields = [];

for (var i=0; i<this.numFields; i++) {

     var f= this.getField(this.getNthFieldName(i));

     if (f.type!="button" && f.required ) {

          if ((f.type=="text" && f.value=="") || (f.type=="checkbox" && f.value=="Off")) emptyFields.push(f.name);

     }

}

if (emptyFields.length>0) {

     app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n"));

}

TOPICS
Acrobat SDK and JavaScript

Views

76

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Hi,

New Here ,
Jun 30, 2019

Copy link to clipboard

Copied

Kindly answer the code to find empty fields only in current page out of many page in PDF..

The below code works well for all page. But i require only for current page which i'm using at that time.

var emptyFields = [];

for (var i=0; i<this.numFields; i++) {

     var f= this.getField(this.getNthFieldName(i));

     if (f.type!="button" && f.required ) {

          if ((f.type=="text" && f.value=="") || (f.type=="checkbox" && f.value=="Off")) emptyFields.push(f.name);

     }

}

if (emptyFields.length>0) {

     app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n"));

}

TOPICS
Acrobat SDK and JavaScript

Views

77

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 30, 2019 0
Adobe Community Professional ,
Jul 02, 2019

Copy link to clipboard

Copied

You can check the property page of the field.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2019 0