These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Global show/hide of a single object in a reapeated subform

shawn_loc
Registered: Mar 30 2009
Posts: 11

I' building a form in LC Designer 8 with a repeated subform that contains 5 text fields. I have placed a radio button pair at the top of the form to show/hide textfield5 in the repeated subform. I have also added add/remove buttons below the repeated subform. The form initializes with three instances of the repeated subform with a max of 50 occurrances, and a min of one. I am struggling with being able to control the presence of textfield5 in all the repeated subforms with the radio button pair at the top of the page. I tried using the pageContent function but the problem is that it only affects items on a single page, whereas I need all the fields in the entire document to respond to the radio button pair.
 
Currently I have this code in my 'show' radio button click event
 
for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)
{
var fields = xfa.layout.pageContent( nPageCount, "field");
}
var total = 0;
for (var i=0; i <= fields.length-1; i++)
{
if (fields.item(i).name == "notes")
{
fields.item(i).presence = "visible";
footertextfield.presence = "visible";
}
}

My Product Information:
LiveCycle Designer, Windows
shawn_loc
Registered: Mar 30 2009
Posts: 11
nevermind, i gave up on javascript and used FormCalc instead. it was much easier. I used

p1.subform.sub[*].textfield5.presence = "visible"

that's it!