Can someone help me with a Code that allows you to hide all but the first few fields when the form opens

My form has a section (subform) on top that is always open and then underneath it is dynamic and I want some subforms and sections to open based on users to input. I use action Builder to open the screen and have all the fields that are hidden, but I have too much subforms and must hide individually all subforms. Is there a code that allows you to hide all fields for me when the form opens, and then I can use action Builder to open just what I need based on a drop-down list button or radio?

Thank you!

Hello

Using LockAllFields of Paul's example, you could place the JavaScript code within the root node docReady event (normally 'form1').

Please note that the last line is the presence of one of the subforms to visible return. Let's call it ShowThisSubform.

// Declare some variables
var allChildElements;
var intNumElements;
var currentElement;
var j;

// Get all the child nodes of the parent element (the root node/"form1")
allChildElements = this.nodes; // "this" will use the element where the script is placed

//Total number of element in the object
intNumElements = allChildElements.length;

// Loop through all the child elements
for (j=0; j< intNumElements; j++) {
     currentElement = allChildElements.item(j);
     // If the element is a subform we'll hide it
     if (allChildElements.item(j).className == "subform") {
          allChildElements.item(j).presence = "hidden";
     }
}

// Show one of the subforms
ShowThisSubform.presence = "visible";

Niall

Tags: Adobe LiveCycle

Similar Questions

Maybe you are looking for