I need to lock all the fields in a form, after clicking a button.
I have used the following script, seen in the documentation, but when I save the form and reopen it, the fields are all again editable.
//Disabling all form fields
function disableAllFields() {
// Get the field containers from each page.
for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
var oFields = xfa.layout.pageContent(nPageCount, "field");
var nNodesLength = oFields.length;
// Set the field property.
for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
oFields.item(nNodeCount).access = "readOnly";
}
}
}
How can disable permanently the fields?