Avatar

Correct answer by
Level 10

Hi Jeeva,

You can do this but would need to resolve the nodes. This is because all three subforms have the same name "Receipt_subform". The [1] is a tag showing the instance, on a zero based numbering system.

If we assume that the three subforms and the button are in the same subform then the following should work (if they are not, then you would need to include the full reference):

xfa.resolveNode("Receipt_subform[" + 1 + "]").presence = "visible";

xfa.resolveNode("Receipt_subform[" + 2 + "]").presence = "visible";

You could do a loop, but it hardly seems worth it for just two objects.

I would recommend having a different name for each subform, as this will make it much easier to reference each one.

Hope that helps,

Niall

View solution in original post