- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Well,
to open the fields, you just need to change the statement from "protected" into "open".
function unlockFields(vNode) {
if (vNode.className === "field") {
vNode.access = "open";
}
for (var i = 0; i < vNode.nodes.length; i += 1) {
unlockFields(vNode.nodes.item(i));
}
}
unlockFields(xfa.form);
But it makes no sense to put this script into the postSave event while also using the lockFields function in the preSave event.
If you'll do so the form to be always editable, because the presSave event always happens after saving the form.
So you should think about the scenarious that might happen in your form to find the suitable events and workflows.
One could be to ask the users, if they want lock the form?
function lockFields(vNode) {
if (vNode.className === "field") {
vNode.access = "protected";
}
for (var i = 0; i < vNode.nodes.length; i += 1) {
lockFields(vNode.nodes.item(i));
}
}
if (xfa.host.messageBox("Do you want to lock all the fields in the form?\n\nFurther changes aren't possible if you click 'Yes'!", "Lock form?", 2, 2) === 4) {
lockFields(xfa.form);
}
Views
Replies
Total Likes