3 Replies Latest reply on Jun 24, 2008 12:55 PM by gkaiseril

    Multiple hidden text fields co-existing in same place?

      I have a form with 3 groups of information (in text fields) for customer to fill out, but only one group will appear depending on their choice of radio button.

      The problem is that due to space issues, all the groups need to be appear in the exact same spot...ie. group 1 will replace group 2 and 3 if selected or vise versa.

      How do I arrange all this information on the page in the same space, hidden except for the buttons. Is there a way to group elements as to program the show/hide together?

      Acrobat 8.1.2

      I have limited programming experience...so be gentle:)
        • 1. Re: Multiple hidden text fields co-existing in same place?
          MarkWalsh Level 4
          To my knowledge, I don't think there is any way to group your fields.

          I'd recommend setting an array for the field names for each group (Note, i quickly wrote this code, haven't tested)

          var group1Names = new Array ("Field1", "Field2", "Field3");
          var group2Names = new Array ("Field4", "Field5");
          var group3Names = new Array ("Field6", "Field7", "Field8", "Field9");

          then I would write a separate function to loop through each array of field names, setting their visibility

          function setFieldVisibility(fieldNames, makeVisible) {
          for(var i=0;i< fieldNames.length;i++) {
          if(this.getField(fieldNames[i]) != null) {
          var oField = this.getField(fieldNames[i]);
          if (makeVisible) {
          oField.display = display.visible
          } else {
          oField.display = display.hidden
          }
          }
          }
          }

          finally, I would set each option to call this function

          e.g., when I want group1 visible

          setFieldVisibility(group1Names, true)
          setFieldVisibility(group2Names, false)
          setFieldVisibility(group3Names, false)
          • 2. Re: Multiple hidden text fields co-existing in same place?
            MarkWalsh Level 4
            Another option which should work would be to use a separate template for each group. (It's been a while since I've used templates, so I can't be sure it would work, but I believe it will)
            • 3. Re: Multiple hidden text fields co-existing in same place?
              gkaiseril MVP & Adobe Community Professional
              The use of templates also assumes no one will be using Reader.