Skip to main content
Known Participant
Jun 5, 2025 2:45 AM UTC
Answered

Toggling show/hide button text

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?

PDF Automation Station
Community Expert
Jun 5, 2025 2:58 AM UTC

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;
}

3 replies

PDF Automation Station
Community Expert
Community Expert
Jun 5, 2025 2:58 AM UTC

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;
}
Translate
try67
Community Expert
Community Expert
Jun 5, 2025 7:34 AM UTC

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

cDate=display.visible;

Should be:

cDate.display=display.visible;

Translate
PDF Automation Station
Community Expert
Community Expert
Jun 5, 2025 12:33 PM UTC

Thank you.  Script corrected.

Translate