Can you use Show/HIde with a button?

I know how to do this with a checkbox, but is there a way to do it with a button? I use the following script for a checkbox;

var showHide = event.target.isBoxChecked(0)?display.hidden:display.visible;


this.getField("ADS.Button.LawEnforcement2").display = showHide;

I have tried to figure this out with a button, but cannot. Can you do it with a button? Any help would be appreciated.


Jack Gillmen


Voted Best Answer

I assume you want to use the same button to both show and hide (click once, the item will be shown, click again, it will be hidden).

You can do the following in the action script of the button:

if (this.getField("Text2").display == display.hidden)
{
    this.getField("Text2").display = display.visible;
}
else
{
    this.getField("Text2").display = display.hidden;
}

Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com


By Karl Heinz Kremer   


Please specify a reason: