Skip to main content
Inspiring
August 9, 2023
Answered

Adding editing restrictions affect the ability to export the XFDF file

  • August 9, 2023
  • 1 reply
  • 641 views

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




This topic has been closed for replies.
Correct answer try67

"Content Copying: Not Allowed"

This means you can't extract any content from the file, including form data. You must change your policy to allow that if you want your code to work.

1 reply

try67
Community Expert
Community Expert
August 9, 2023

Does your security policy allow content extraction?

KaxkulAuthor
Inspiring
August 9, 2023

Not sure where to figure out but this what I can see:

 

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 9, 2023

"Content Copying: Not Allowed"

This means you can't extract any content from the file, including form data. You must change your policy to allow that if you want your code to work.