3 Replies Latest reply on Oct 26, 2014 6:43 PM by MichaelN

    Hiding A Specific Textbox

    knieber

      Hello,

       

      So, I'm creating a radio button that will have options on the top that change the type of form you're filling out. For example, if you click "Closing Account" then the box "What date will you stop working?" and the text field next to it will be visible. However, if you click "Opening Account", then the previous text box "What day will you stop working?" and the text field next to it will disappear. The problem I'm having is that the text field has an ID, but I don't know how to find the ID of the specific textbox. Here is what I have:

       

      getField('CloseDateField').display = display.hidden;

       

      This works fine for the text field next to the textbox, but how do I select the textbox to make it disappear as well whenever it doesn't have an ID. As in, what field is getField() supposed to select when the textbox doesn't have one? I hope my question makes sense. If it's confusing, please ask how I can clarify. Thanks in advance!

        • 1. Re: Hiding A Specific Textbox
          MichaelN Level 3

          All fields have a name. You can find out what the name of a field is by right clicking on a field, choosing properties, and looking in the General tab.


          For example, if a text field's name is "Text1", the script would be:

           

          getField('Text1').display = display.hidden;
          
          • 2. Re: Hiding A Specific Textbox
            knieber Level 1

            MichaelN,

             

            Thank you for your answer. However, I may have miscommunicated. I'm trying to select a textbox, not a textfield. For example, in Acrobat Pro I go to Tools > Content Editing > Add Text. The text I'm adding with the Add Text tool is the text I'm trying to select. Maybe I'm going about adding the text the wrong way to be able to select it. Again, thanks for the help.

            • 3. Re: Hiding A Specific Textbox
              MichaelN Level 3

              Text boxes are a type of annotation. You should look at the properties of the Annotation object.

              There is a "seqNum" property which is a sequence number for the annotation on the page, but I have not tested it.

               

              Having re-read your original post, however, I don't think you should use text boxes. The text "What day will you stop working?" should appear in a normal text field, as should the text field for the user to enter a date.