Avatar

Level 10

Hi Jake,

The script in the click event is nearly there.

You are correctly resolving the repeating instance of Subform1; however you are not passing this through to the function.

When you call the function you are only passing through the first instance of the subform. In addition you are tagging on 'bhiinput'. This is why it only works for the first instance.

In the loop you would need to fully resolve the subform that you want and then pass this through to the function.

var j = _Subform1.count; 


for (var i=0; i<j; i++)
{
     var currentSubform = xfa.resolveNode("Subform1[" + i + "].bhiinput");
     myScriptObject.LockAllFields(currentSubform);
}

See how you tag on the desired subform inside the repeating subform when resolving the node.

Fingers crossed this should work!!

Niall