0

我有一个表格,一旦填写完毕,我想锁定它以供演示。我知道如何通过一个按钮来实现这一点,以将文本字段呈现为只读。现在我有一个包含重复子表单的表单(根据需要添加)。如何编写单个按钮的脚本,使其适用于所有子窗体中的对象?

子表单是“ItemGroup”的迭代。我需要使“ItemGroup.Item”和“ItemGroup.ItemRx”只读,并且“ItemGroup.ItemHeader.Button”不可见。

4

1 回答 1

0

我在家,因此未经测试。如果您遇到麻烦,请告诉我。

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";
    }
}
于 2014-03-14T23:24:13.590 回答