Page Validation
Hello! I am trying to add a button on each page of my PDF to validate all required fields on that page only. I have the below code, but this validates the required fields in the entire document. Anybody know how to make it page specific?
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("The following fields are required:\n" + emptyFields.join("\n"),1,0, 'Validation Error');
}
else app.execMenuItem("SaveAs");