1 Reply Latest reply on Sep 15, 2017 7:06 AM by George_Johnson

    Populate text field spawned from a template based on a separate text field from a different spawned template.

    simonc57895329 Level 1

      I have a .pdf with a 'cover page' followed by six hidden templates.

       

      Template 1 is called 'PreSurvey1' and template 4 is called 'PostSurvey1' (the others are not required in relation to this question).

       

      When clicked, a button on the cover page automatically spawns a copy of each of these templates which appear in sequential order below. This can be done multiple times but the order in which the templates are spawned never changes.

       

      I have a text field called TripDates_TB which appears on both Template 1 and 4. However, when the pages are spawned from the templates they assume the prefix P1.PreSurvey1.TripDates_TB and P4.PreSurvey1.TripDates_TB.  This means that the two fields are no longer linked (i.e. you have to enter data into each individually rather than it automatically populating the second instance).

       

      So my question is, how would I go about linking them? I have been through the forum and my current thinking is that I would need to use javascript to split the instance of TripDates_TB on Template 4 and then update the prefix along the lines of P4-3 (i.e. giving a value of P1).

       

      This should then hold true for additional spawns? (i.e. a second round of templates spawns would produce  P7 and P10 so P10-3 would equal P7).

       

      I have tried with my limited understanding of javascript to come up with something like this but am having no success.

       

      Any help would be much appreciated!