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

Show/hide form fields with tabs (buttons)

wildblue
Registered: Aug 28 2007
Posts: 2

Is there a way to create a pdf with tabs that will show and hide form fields that are associated with each tab? I have a form that has twenty five rows and thirteen columns. The columns are split up into two different tabs that are switched between by using layer visibility. The first tab has seven columns, the second tab has six. I am trying to have tab 1 show it's form data for it's twenty five rows/seven columns, and when tab two is pressed it will hide tab ones data and display it's own and vice versa. I currently have tried a checkbox script:
 
// Determine if Check box is marked then use value to show or hide Shipping Address Fields
var nHide = event.target.isBoxChecked(0)?display.visible:display.hidden;
 
// Get each field in the shipping address info and set to show/hide value
this.getField("opt1Text7").display = nHide;
  
This however forces the user to press the tab twice to turn form fields on and off and makes it very confusing. Is there a script I can apply to a button for each tab that will do what I am looking for? Thank you for your help!

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
First, write a function that hides all of the controls. Call this each time the tab is changed, before you set the current fields to visible.

When you say that you are using a check box script I assume you mean that you are using a check box at the head of each column. If this is the case then all you need to do is replace it with a button.

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