Method that returns type of controls (buttons, radio, textfeild, etc) | Community
Skip to main content
New Participant
November 12, 2021
Solved

Method that returns type of controls (buttons, radio, textfeild, etc)

  • November 12, 2021
  • 1 reply
  • 713 views

Dear all, 

     I'm usinf LiveCycle ES2 and trying to hide all buttons in the PDF forms when a signatures is inputted. To do so, I have to loop through all nodes/fields in the form using the below function, but I could not help finding the method that returns the type pf field/controls so that I only hide buttons not others fields/controls such as textfield, radio, signature etc..Can anyone help me to find the method that return the type of control/field please? The place where I need this method is surrounded by @@@. 

 

function ProcessAllFields(oNode)
{
if (oNode.className == "exclGroup" || oNode.className == "subform" || oNode.className == "subformSet" || oNode.className == "area")
{
for (var i = 0; i < oNode.nodes.length; i++)
{
var oChildNode = oNode.nodes.item(i);
ProcessAllFields(oChildNode);
}
}
else if (oNode.className == "field" && @@@@ oNode type is "button" @@@)
{
oNode.presence = "hidden";
}
}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Tiwari

Hi @aaa10013 ,

Yo may use className[0] property to get the type of object, as mentioned here under  "Accessing a field property" section.

https://help.adobe.com/en_US/AEMForms/6.1/DesignerScriptingRef/WS92d06802c76abadb-3e14850712a151d270d-7ffa.2.html

 

 

[0]: https://help.adobe.com/en_US/AEMForms/6.1/DesignerScriptingRef/WS92d06802c76abadb-3e14850712a151d270d-7ff4.2.html

 

 

 

1 reply

Mayank_Tiwari
Mayank_TiwariAccepted solution
Employee
November 12, 2021
Mayank_Tiwari
Employee
November 12, 2021

Also, By default, signing Signature field doesn't hide the objects, but it rather locks them.

You may see this sample form for how to lock specific objects in the form on signing the Signature field.

https://drive.google.com/file/d/1mDG3NxvfohFs-bcM-nB1oDoajeM3mfRW/view?usp=sharing