Avatar

Level 4

I found out what was causing the problem was my own misunderstanding of the loop variables.  currentElement is designed to be the child of wherever the function is called from. 

So I changed the if/then statement in the function to affect currentElement's parent:

      if(currentElement.className === "subform") {    

                              if (xfa.resolveNode("form1.Page1.Page1.#subform.institutiontype").rawVal ue == :smiling_face_with_sunglasses: {

                              currentElement.parent.presence = "visible";

                              }

                              else {currentElement.parent.presence = "hidden";

                              }

                      }