0
votes

I have a form that I want to lock for presentation once it is filled out. I know how to make this happen with a button to render the text fields read-only. Now I have a form that involves repeated subforms (added as needed). How can I script a single button so it will work for the objects in all the subforms?

The subforms are iterations of "ItemGroup". I need to make "ItemGroup.Item" and "ItemGroup.ItemRx" read-only, and "ItemGroup.ItemHeader.Button" invisible.

1

1 Answers

0
votes

I'm at home, hence untested. Let me know if you bump into trouble.

var sfSom = "<path/somExpression to subform containing ItemGroups>"; var nn, n = xfa.resolveNode(sfSom).nodes;

for (var i = 0; i < n.length; i++) {
    nn = n.item(i);
    if (nn.name == "ItemGroup" && nn.className == "subform") {
        /* change stuff here. Decide if Item and ItemRx should be read-only, calculate or protected. For now, we'll settle for hiding the button:  */
        nn.ItemHeader.Button.presence = "hidden";
    }
}