These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Hiding a page or area of a page unless a submit or button is selected

teros
Registered: Feb 3 2008
Posts: 21

Hey all,

Here is my issue basically i want to have an area of the page viewable if a certain button is selected then this area will become viewable and allow data to be written.

The idea is basically a yes/no button is the user selects no nothing happens if yes then the hidden area becomes visible and then allow data to be entered.

Another issue i am having is that with this hidden part if you click in this area the date should automatically be entered with todays date or when you click in the area.

And also i forgot to say many thanks to thomp for his previous help with my calculations issue your suggestions worked a treat:-).

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The visibility of a field or subform is controled with the "presence" attribute. To show or hide your subform use this JavaScript code for a subform named "MySub".

To Show:
MySub.presence = "visible";

To Hide:
MySub.presence = "invisible";

Set the presense to invisible initially. Do not use the "hidden" value. And save the form as Dynamic. This won't work on static forms.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

R_Boyd
Registered: Nov 1 2007
Posts: 151
I used a similar option but used hidden to ensure that it only appeared when the relevant option was selected from the drop down field.

This means that the subform below it will move when the option has been selected rather than the invisible option that leaves a gap.

e.g

A - Visible
B - Hidden
C - Visible

is shown to the user as

A
C

As soon as they select the relevant value from the drop down in A, B is revealed pushing C down

A
B
C

I applied the following JavaScript to the exit event on the drop down and set the presence of the bank_details subform (B in the example above) to Hidden.

if (this.rawValue == 1){bank_details.presence = "visible"; }else{bank_details.presence = "hidden";}