Skip to main content
Known Participant
June 5, 2025
Answered

Toggling show/hide button text

  • June 5, 2025
  • 1 reply
  • 512 views

Good day Pros,

 

              I am looking to toggle three different boxes. The toggle box is "Unhide" and it unhides two other boxes. "Convening Date" and "Graduating Date". I have a third box "CT NOTE" that hides these two boxes. I want the Unhide box to hide both the Convening Date and Graduating Date boxes and Show the CT NOTE box. When clicked it would do the reverse. It will unhide both text boxes but hide the CT NOTE box. Is this possible?

Correct answer PDF Automation Station

If Unhide is a button field, enter the following mouse up action script:

var cDate=this.getField("Convening Date");
var gDate=this.getField("Graduation Date");
var ctNote=this.getField("CT Note");

if(cDate.display==display.hidden)
{
cDate.display=display.visible;
gDate.display=display.visible;
ctNote.display=display.hidden;
}
else
{
cDate.display=display.hidden;
gDate.display=display.hidden;
ctNote.display=display.visible;
}

1 reply

PDF Automation Station
Community Expert
Community Expert
June 5, 2025

If Unhide is a button field, enter the following mouse up action script:

var cDate=this.getField("Convening Date");
var gDate=this.getField("Graduation Date");
var ctNote=this.getField("CT Note");

if(cDate.display==display.hidden)
{
cDate.display=display.visible;
gDate.display=display.visible;
ctNote.display=display.hidden;
}
else
{
cDate.display=display.hidden;
gDate.display=display.hidden;
ctNote.display=display.visible;
}
try67
Community Expert
Community Expert
June 5, 2025

You forgot the .display part of each of the lines in the brackets, e.g.:

cDate=display.visible;

Should be:

cDate.display=display.visible;

PDF Automation Station
Community Expert
Community Expert
June 5, 2025

Thank you.  Script corrected.