3 Replies Latest reply on Nov 14, 2013 2:03 PM by JimDandy

    Repeating subform

    JimDandy

      I have a need to repeat a subform for an agenda, the individual agenda items,and I'd like to use a button to add and/or subtract subforms for new agenda items.

       

      I've accomplished something similar in the past by filling out the entire form with the fields and hiding them initially while using a button to display them as necessary but in this instance, the fields are set to expand as needed, and that makes it difficult to place static fields below.

       

       

      I’d also like the subforms to span onto a second page if needed but to start the flow beneath the header from the master page if possible.

       

      Here is a link to the example: https://workspaces.acrobat.com/?d=YDXAEeVkXYe4clOJ*V5Evw

       


        • 1. Re: Repeating subform
          JimDandy Level 1

          I was able to create the form I wanted from the post above, repeating subforms and all. I could now use a little assistance with one element of this form however. In the form at the link below, whenever I click on the "Add Topic" button, I would like to remove the "X"/delete button from the previous subform. This way only one repeating subform, the last one added, can be deleted.

           

          Any assistance with this is greatly appreciated.

           

          The link to the document is: https://workspaces.acrobat.com/?d=-swlUm4H7JLsYiei5JUwPA

          • 2. Re: Repeating subform
            jasotastic81 Level 3

            The document is not shared in such a way that I can get it; however, I may be able to help anyway.

             

            If you're using JavaScript, in the "click" event for the 'Add Topic" button, add this line at the end:

             

            this.parent.btnDeleteButton.presence = "invisible";

             

            I don't know what you've actually named the delete button; so, change "btnDeleteButton" to whatever you've named that button.

            • 3. Re: Repeating subform
              JimDandy Level 1

              Your advice was very helpful. It led me to the solution. I ended up with the following code:

               

                  _AgendaItem.removeInstance(this.parent.index); // Short form of the instance manager syntax

               

              There are similar portions for adding items too, so thank you very much for getting me to a solution. It is very much appreciated.