Skip navigation
Currently Being Moderated

Line Count & Multiple Text Fill in Static Form

May 3, 2012 5:24 AM

Tags: #javacsript #creation #livecycle_es2 #populate_textbox #static_form #livecycle_form_calculation #multiple_pages

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. The other problem I have is that the loop on the first page is not stopping at the line count I requested.

 

I've tried various 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!

 

//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";

          }

     }

}

 
Replies
  • Currently Being Moderated
    May 7, 2012 9:39 AM   in reply to Miss Caroline

    Hi,

     

    you should check out this solution from John Brinkman.

    It covers your needs and also works in static, interactive forms.

     

    http://blogs.adobe.com/formfeed/2009/04/field_tab_on_full.html

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points