Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

How to add text fields with a button click

Avatar

Former Community Member

Hi!  I'm really really new to LiveCycle (I'm using LiveCycle Designer 7), so I'm sorry if this is a really dumb question.  I've just been learing as I go, since my company won't pay for any training.  There may be a thread on this already, but I don't really know what to enter in the search to find it.

I'm making form where I want the user to add lines of text (ingredients in a recipe).  I want them to be able to click a button and it will add another text field for them to type in, while moving down the text field below it.  I know that I need to wrap them in a sub-form, right?  But I don't know what to do after that.  I'm attaching the form I have made so far, so maybe this will make more sense.

If this is too complicated for me to do, just let me know.  This is all an experiment at this point.  I thought that this might be better to use than Excel since I'm probably going to get over 100 of these back.  If anyone has any ideas of alternatives that would be great too.

Thanks so much!!!

1 Reply

Avatar

Level 2

hi,

To add a Text field with Button Click, for a button in Click Event you have write scripting(javascript) like

body.ingredients.TextField2.instanceManager.addInstance(1);

so that new text field will be added for every click.

To achieve this you have already wrap in subform, but in the object pallete of this subform you should maintain Subform Content as Flowed and for the same subform in Object Pallete in Binding tab Repeat Subform for each dataitem should be checked and minimum count is equal to 1.

and also the main subform which is the starting root node should also be Flowed.

i am attaching the same form of yours with some changes and you can find the difference.

Thanks & Regards,

Madhu.