How to Dynamically Number Subform Instances

Avatar

23-01-2007

I have a form that is enabled to let users add as many instances of a particular subform as needed; however, one thing I would like to add would be an automatic 'numbering' on the form of the instances.



So, if the user adds three subforms to the original, each subform will have a text field in it that contains the instance number (plus one, I think?), so the user will see each section labeled 1, 2, 3, and 4, etc.



I know instances start at 0, and I am new to js and LiveCycle, so I'm not 100% sure how to first return the instance index number to a text field, and then get it to appear correctly in each subform.



Thank you,

Replies

Avatar

23-01-2007

I have added this script to the 'Calculate' event of the field to display the row/instance number followed by a dot.. just remove the **+'.'** if you don't want the dot



this.rawValue = (subformName.index) + 1 +'.';

Avatar

Avatar

Vijayalakshmi

Avatar

Vijayalakshmi

Vijayalakshmi

30-09-2016

Thank you Chris