# LiveCycle Designer - using buttons to add subforms



## ttianna (Oct 13, 2009)

I am creating a dynamic form in LiveCycle Designer. This is my first experience with this software, so I am piecing it together as I go. I need to use buttons to create instances of subforms as needed by the user. I was able to make it work for two buttons, but I can't get the rest of the buttons to work.

I have attached my form. It's a doozy. It seems like it's a getting a little out of hand - too complicated with too many subforms, but I'm not sure how else to organize it. This form is for a complicated task with a lot of variables. I would also like to know how to set it up so that only the parts the user is seeing render to reduce load time. If you are looking at my form and have any ideas about how to better organize it, I welcome the suggestions. This is my first attempt at working with LiveCycle.


Anyway, back to my original question.

assessment.addanotherstandard.addanotherstandard_btn works to add an instance of assessment.Standards.Standardsdetail

and

assessment.addanotherobjective.addanotherobjective_btn works to add an instance of assessment.Objectives.objectivesdetail.objectivesdetail



However, these buttons/subforms are not working:



assessment.Questions.Questionset.Questiondetail.MCdetail.addanswer_btn::click - (JavaScript, client)

xfa.form.assessment.Questions.Questionset.Questiondetail.MCdetail._answer.addInstance(1);



assessment.Questions.Questionset.Questiondetail.Matchingdetail.addmatch_btn::click - (JavaScript, client)

xfa.form.assessment.Questions.Questionset.Questiondetail.Matchingdetail._matches.addInstance(1);



assessment.Questions.Questionset.Questiondetail.MSdetail.addanswer_btn::click - (JavaScript, client)

xfa.form.assessment.Questions.Questionset.Questiondetail.MSdetail._answer.addInstance(1);



assessment.Questions.Questionset.Questiondetail.orderingdetail.addanswer_btn::cl ick - (JavaScript, client)

xfa.form.assessment.Questions.Questionset.Questiondetail.orderingdetail._orderinganswer.addInstance(1);



I checked that the parent subform was set the flowed and the child was set to positioned. And I checked that I was allowing more than one instance of each.


----------

