Is it possible to hide all instances of a subform with a single line of javascript? I'm trying something like this:
repeatingSubform[*].presence = "hidden";
but that causes designer to crash...
Or, must I loop through all instances of the subform and turn each one off individually?
Thanks,
Elaine
Solved! Go to Solution.
Views
Replies
Total Likes
Views
Replies
Total Likes
You have to turn them off individually
Paul
Views
Replies
Total Likes
another javascript common method to hide all instances of a subform:
//parameters:
//subform: string containing the subform name - fully qualified i.e. parent.parent.subform...
//presenceSetting: string containing the text "hidden" or "visible"
function changeDynamicSubformPresence(subform, presenceSetting)
{
numInstances = xfa.resolveNode(subform).instanceManager.count;
for (var i=0; i<numInstances; i++)
{
xfa.resolveNode(subform + "[" + i + "]").presence = presenceSetting;
}
}
calling the method:
formScript.changeDynamicSubformPresence("subformName", "hidden");
--Elaine
Views
Replies
Total Likes
Of course, you can wrap the repeating subforms in a parent subform and then hide the parent with one line of code
Ben Walsh
Views
Replies
Total Likes
Oh, you sneaky little avoka-devil, you. Very clever. I'll remember
that next time, I already wrote the "looping" code
Thanks Ben!
Elaine
Views
Replies
Total Likes
This answer was helpful but I have a new question about this: How would one loop through the instances and turn off depending on a condition?
So upon a click event loop through all instances, if a certain radio button is selected hide that row and leave the others alone?
Thank you.
Views
Replies
Total Likes
I am popping out of here into a new posting.
Views
Replies
Total Likes
Views
Likes
Replies