2 Replies Latest reply: May 20, 2012 8:02 AM by Miss Caroline RSS

    Line Count & Multiple Text Fill in Static Form

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

                }

           }

      }

        • 1. Re: Line Count & Multiple Text Fill in Static Form
          radzmar Community Member

          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

          • 2. Re: Line Count & Multiple Text Fill in Static Form
            Miss Caroline Community Member

            Thanks for responding, radzmar. I apologize for my delay in the thanks. I've been tied up in meetings, and this is the first opportunity I've had to reply! And what the heck happened to the formatting on this page??? Everything in my view is squished in a column on the right!

             

            Okay, I've got the tab order set, and I get my data to stop on the 1st text box correctly, but it still isn't overflowing into the 2nd text box. I thought it might have something to do with the fact that the 2nd text box is on another page, and I wasn't sure about the proper syntax on the function call for the 2nd page field to reference back to the first page. So I shrunk the first text box and added one on the same page to see if the code was working properly to move the overflow data, and it isn't.

             

            The big difference I notice between Mr. Brinkman's code and mine is that he is building his text field with user input directly into the field in question. On my forms, I'm displaying a text box and using the user input data from the displayed text box to calculate a group text box on another page, and I suspect this is the causing the problem but is how I have to do it. It's the overflow from the group text box that I want to move to a subsequent page/text box.

             

            Any ideas, and any additional information I can provide to facillitate assistance? I'm using LiveCycle Designer 10, and I noticed his example is geared towards 8. I've been self-teaching myself this stuff and know there are probably better ways to accomplish my goals with this form, but because of time constraints, I haven't been able to research the BEST way to accomplish what I'm doing here, so I try to meld my code with the examples I've found. Everyone on these forums has been so helpful!