I'm trying to create a dynamic caption field that essential will make the text fields look like a list. At first I searched on how to do this. I eventually found a way to do it, and that is simply to to count how many instances of the text field I have and set the caption value:
var curObject = prospectus.page1.step1.ObjectivesSubform.Objectives.instanceManager.count;
prospectus.page1.step1.ObjectivesSubform.Objectives[curObject-1].Objective.caption.value.text.value = concat(curObject, ":");
And that allows my form to work very well and the numbers to load very well in the form. The trouble that I'm having is that after I save the form and reload it, the numbers go back to 1 for each text field. Anyone have an idea?
*To test what I'm seeing, simply go to "Project Objectives" and click Add Objective to create at least 2 extra text fields (so that you have at least 3 overall). Save the form and notice that the numbers have gone from 1,2,3 to 1,1,3. This will be the same if you create any amount. If you create 5 more it will go 1,1,1,1,5. I'm stumped.