3 Replies Latest reply on Aug 30, 2013 8:52 AM by mrfale67

    Dynamically use page number in form field on spawned pages?


      I have a form with spawned pages.  JS for spawning page(s) works fine.  However, one text field on template is driving me nuts.  I would like this field ("CaseNum") to dynamically display page number, since page number also corresponds to case number.  On templage ("getcase"), I can calculate value for CaseNum using custom calc script (event.value = this.PageNum).  But that doesn't work because every spawned page gets the same value (ie, whatever is last spawned page number). I also tried JS below, using P0.getcase.CaseNum as the field on the template in which I want the page number/case number to be displayed:


      var oPage = this.pageNum;

        this.getField("P" + oPage + ".getcase" + ".CaseNum").value = oPage;


      But, this doesn't work either, because the field on the spawned page automatically gets the prefix of P + page number + .getcase appended to the field name.  Is there any way to dynamically used page number in a form field on spawned pages?  If so, how? Note that while I am trying to use a dynamic case number on spawned pages, it presents the same issue as dynamically displaying page numbers on spawned pages.  I'm a JS newbie, so any help appreciated.  I've searched high and low on web and in forums and couldn't find the answer.  Thx.