2 Replies Latest reply on Apr 21, 2012 5:22 PM by Miss Caroline

    Populate overflow data in text boxes on a static form with no duplication

    Miss Caroline

      I've created a static .pdf form using LiveCycle Designer ES2 with JavaScript. I'm transferring user-input data to a calculated text box. I know if the form was dynamic, I could force a new page when the data in the calculated text box overflows. For various reasons, I've chosen a static form instead and am trying to add a 2nd page with a calculated text box in case data overflows from the first text box. This is so that if the user prints the form, they can see all the data without doing multiple prints. The problem is I can't come up with the proper JavaScript to cause JUST the overflowed data to move to the 2nd text box. I either get all or none. I've tried code edits, but the code below, which I have in the topmostSubform::calculate - (JavaScript, client) section, is what I have currently. With this code, no data populates to the txtAllComm2 text box. Can someone please help me debug this? I've been working for hours on this trying different things and am out of ideas. Thanks in advance!

       

      var lineCount=0;

      Page6.txtAllComm.rawValue = " "

      Page7.txtAllComm2.rawValue = " "

       

      //calc code

      //Page1

      if(lineCount<=30){

      for (i=1; i<=23; i++)

      {

        if(xfa.resolveNode("Page1.txtComm"+i).rawValue != null)

        {

         lineCount++;

         Page6.txtAllComm.rawValue += xfa.resolveNode("Page1.txtComm"+i).rawValue + lineCount + "\n";

        }

      }

      }else if(lineCount >=31){

      for (i=1; i<=23; i++)

      {

        if(xfa.resolveNode("Page1.txtComm"+i).rawValue != null && xfa.resolveNode("Page1.txtComm"+i).rawValue != xfa.resolveNode.Page6.txtAllComm.rawValue)

        {

         lineCount++;

         Page7.txtAllComm2.rawValue += xfa.resolveNode("Page1.txtComm"+i).rawValue + "\n";

        }

      }

      }

      //Page 2

      if(lineCount<=30){

      for (i=24; i<=50; i++)

      {

        if(xfa.resolveNode("Page2.txtComm"+i).rawValue != null)

        {

         lineCount++;

         Page6.txtAllComm.rawValue += xfa.resolveNode("Page2.txtComm"+i).rawValue + lineCount +"\n";

        }

      }

      }else if(lineCount >=31){

      for (i=24; i<=50; i++)

      {

        if(xfa.resolveNode("Page2.txtComm"+i).rawValue != null && xfa.resolveNode("Page2.txtComm"+i).rawValue != xfa.resolveNode.Page6.txtAllComm.rawValue)

        {

         lineCount++;

         Page7.txtAllComm2.rawValue += xfa.resolveNode("Page2.txtComm"+i).rawValue + "\n";

        }

      }

      }

      //Page3

      if(lineCount<=30){

      for (i=51; i<=77; i++)

      {

        if(xfa.resolveNode("Page3.txtComm"+i).rawValue != null)

        {

         lineCount++;

         Page6.txtAllComm.rawValue += xfa.resolveNode("Page3.txtComm"+i).rawValue + lineCount +"\n";

        }

      }

      }else if(lineCount >=31){

      for (i=51; i<=77; i++)

      {

        if(xfa.resolveNode("Page3.txtComm"+i).rawValue != null && xfa.resolveNode("Page3.txtComm"+i).rawValue != xfa.resolveNode.Page6.txtAllComm.rawValue)

        {

         lineCount++;

         Page7.txtAllComm2.rawValue += xfa.resolveNode("Page3.txtComm"+i).rawValue + "\n";

        }

      }

      }

      //Page 4

      if(lineCount<=30){

      for (i=78; i<=97; i++)

      {

        if(xfa.resolveNode("Page4.txtComm"+i).rawValue != null)

        {

         lineCount++;

         Page6.txtAllComm.rawValue += xfa.resolveNode("Page4.txtComm"+i).rawValue + lineCount +"\n";

        }

      }

      }else if(lineCount >=31){

      for (i=78; i<=97; i++)

      {

        if(xfa.resolveNode("Page4.txtComm"+i).rawValue != null && xfa.resolveNode("Page4.txtComm"+i).rawValue != xfa.resolveNode.Page6.txtAllComm.rawValue)

        {

         lineCount++;

         Page7.txtAllComm2.rawValue += xfa.resolveNode("Page4.txtComm"+i).rawValue + "\n";

        }

      }

      }

      //Page 5

      if(lineCount<=30){

      for (i=98; i<=107; i++)

      {

        if(xfa.resolveNode("Page5.txtComm"+i).rawValue != null)

        {

         lineCount++;

         Page6.txtAllComm.rawValue += xfa.resolveNode("Page5.txtComm"+i).rawValue + lineCount +"\n";

        }

      }

      }else if(lineCount >=31){

      for (i=98; i<=107; i++)

      {

        if(xfa.resolveNode("Page5.txtComm"+i).rawValue != null && xfa.resolveNode("Page5.txtComm"+i).rawValue != xfa.resolveNode.Page6.txtAllComm.rawValue)

        {

         lineCount++;

         Page7.txtAllComm2.rawValue += xfa.resolveNode("Page5.txtComm"+i).rawValue + "\n";

        }

      }

      }