Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

How can I hide all blank fields on a page?

$
0
0

Hello

 

I want to hide all blank fields but to exclude tables as it messes up the table. It hides that blank cell with the borders and the table doesn't look right.

Currently my script below works it hides all the blank fields on that page.

 

Is it possible to get it to exclude on tables?

 

Thanks to all in advance.

 

function hideFields(myParentObject){

 

   var allChildElements;

 

var intNumElements;

 

var currentElement;

 

var j;

 

var temp;

 

//Get all the child nodes of the parent element

 

allChildElements = myParentObject.nodes;

 

//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 another subform we'll recusively call the function again

 

if(allChildElements.item(j).className === "subform"){

 

//if(currentElement.layout === "table"){ }

 

//else{

 

//}

 

elseif(currentElement.className === "subformSet"){

 

//If the objects are fields, then we will want to hide them them

 

elseif(currentElement.className === "field"){

 

//Check to see if the field is a button - do not count buttons

 

temp = currentElement.name;

 

if (temp.substring(0,6) !== "Button"){

 

if (currentElement.rawValue == "" || currentElement.rawValue ==null){

 

currentElement.presence = "hidden";

 

//Check for exclusion groups - Radio Buttons

 

elseif(currentElement.className === "exclGroup"){

 

// hide the exclusion group and not the individual radio buttons

 

if (currentElement.rawValue === ""){

 

currentElement.presence = "hidden";

 

} // end of for loop

 

} // end function


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>