Adding editing restrictions affect the ability to export the XFDF file
My apologies for highlighting many questions, as I'm keen to learn more and more. In my form, I have a button to check if all required fields are filled, and if yes, it will save the file into XFDF format. What I've realized is that when I add security restrictions to my form, the button is still able to check for missing fields. However, when all fields are filled in, the export function doesn't run (no pop-up window appears to save the file).
Does anyone know why this might be happening? Thank you very much. Below is the code I'm using:
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.valueAsString === f.defaultValue) {
emptyFields.push(f.name);
}
}
}
if (emptyFields.length > 0) {
app.alert("Please complete the following fields:\n" + emptyFields.join("\n"));
} else {
this.exportAsXFDF();
}
Thanks a lot
