1 Reply Latest reply on Feb 9, 2013 3:10 PM by George_Johnson

    How to make all fields on a specific page invisible

    TechnoGeek Level 1

      Is there a way to cycle through all the fields on one specific page to make them invisible?  I'd prefer not to use a template.

        • 1. Re: How to make all fields on a specific page invisible
          George_Johnson MVP & Adobe Community Professional

          Sure. A field has a "page" property which returns the page number (or numbers in an array if the fields with the same name are on multiple pages) that the field is on. If it matches the page in question, you can set the display field property to display.hidden.


          This page shows a script that loops through the collection of fields in the document and toggles the border color property, which isn't much different than what you want to do: http://kb2.adobe.com/community/publishing/885/cpsid_88564.html


          So you will have to adapt it a bit, but it should get you started.


          A far easier approach is to give each field on the page the same prefix using hierarchical naming and you can then use a single line of code. For example, if you prefix each field on page 4 with "P4." (e.g., P4.name, P4.address, P4.state, etc.), the following code will hide all of the P4 fields:


          getField("P4").display = display.hidden;