11 Replies Latest reply on Jul 18, 2013 3:22 PM by try67

    JavaScript Line Limits in Adobe Forms

    Heather_Pennington

           Is there a limit of JavaScript lines that can be entered into a field in a form?  If yes, is there a work around?

        • 1. Re: JavaScript Line Limits in Adobe Forms
          try67 MVP & Adobe Community Professional

          Yes, there is a limit to the amount of characters you can enter into the

          internal JS editor. Not sure what's the exact number, but it's pretty

          big... If you arrive to it, though, the solution is to use an external

          editor, which you can set up via Edit - Preferences - JavaScript - Use

          external JavaScript Editor.

           

           

          On Wed, Jul 17, 2013 at 3:00 PM, Heather_Pennington <

          • 2. Re: JavaScript Line Limits in Adobe Forms
            Heather_Pennington Level 1

            Can you walk me through some more steps.  I've never worked with forms or JS before.  I followed all of the steps you outlined above.  When I got to the use external JS editor, I browsed for the word file I saved my JS in and clicked open.  Was that supposed to make the JS work?  Nothing happened in my form.

            • 3. Re: JavaScript Line Limits in Adobe Forms
              try67 MVP & Adobe Community Professional

              No, you need to select the actual executable of the application that you

              want to use, like notepad.exe.

               

              On a side note, you should NOT write code in a Word document. I was just

              helping someone in another thread who has all kinds of problems (as to be

              expected) because he was doing just that. See my last reply here:

              http://forums.adobe.com/message/5513324

               

               

              On Wed, Jul 17, 2013 at 3:24 PM, Heather_Pennington <

              • 4. Re: JavaScript Line Limits in Adobe Forms
                Heather_Pennington Level 1

                Can I copy & paste my JS from word into notepad, or do i need to completely rewrite my JS in notepad?  Below is the first section of 23 in my full JS, so I REALLY don't want to have to rewrite it all.

                 

                 

                if (event.value == "Select your name to begin the evaluation...")

                {

                this.getField("KPI # 1 Rating").display = display.visible;

                this.getField("KPI # 1 Score").display = display.visible;

                this.getField("KPI # 1 Comment").display = display.visible;

                this.getField("KPI # 2 Rating").display = display.visible;

                this.getField("KPI # 2 Score").display = display.visible;

                this.getField("KPI # 2 Comment").display = display.visible;

                this.getField("KPI # 3 Rating").display = display.visible;

                this.getField("KPI # 3 Score").display = display.visible;

                this.getField("KPI # 3 Comment").display = display.visible;

                this.getField("KPI # 4 Rating").display = display.visible;

                this.getField("KPI # 4 Score").display = display.visible;

                this.getField("KPI # 4 Comment").display = display.visible;

                this.getField("KPI # 5 Rating").display = display.visible;

                this.getField("KPI # 5 Score").display = display.visible;

                this.getField("KPI # 5 Comment").display = display.visible;

                this.getField("KPI # 6 Rating").display = display.visible;

                this.getField("KPI # 6 Score").display = display.visible;

                this.getField("KPI # 6 Comment").display = display.visible;

                this.getField("KPI # 7 Rating").display = display.visible;

                this.getField("KPI # 7 Score").display = display.visible;

                this.getField("KPI # 7 Comment").display = display.visible;

                this.getField("KPI # 8 Rating").display = display.visible;

                this.getField("KPI # 8 Score").display = display.visible;

                this.getField("KPI # 8 Comment").display = display.visible;

                this.getField("KPI # 9 Rating").display = display.visible;

                this.getField("KPI # 9 Score").display = display.visible;

                this.getField("KPI # 9 Comment").display = display.visible;

                this.getField("KPI # 10 Rating").display = display.visible;

                this.getField("KPI # 10 Score").display = display.visible;

                this.getField("KPI # 10 Comment").display = display.visible;

                this.getField("KPI # 11 Rating").display = display.visible;

                this.getField("KPI # 11 Score").display = display.visible;

                this.getField("KPI # 11 Comment").display = display.visible;

                this.getField("KPI # 12 Rating").display = display.visible;

                this.getField("KPI # 12 Score").display = display.visible;

                this.getField("KPI # 12 Comment").display = display.visible;

                this.getField("KPI # 13 Rating").display = display.visible;

                this.getField("KPI # 13 Score").display = display.visible;

                this.getField("KPI # 13 Comment").display = display.visible;

                this.getField("KPI # 14 Rating").display = display.visible;

                this.getField("KPI # 14 Score").display = display.visible;

                this.getField("KPI # 14 Comment").display = display.visible;

                this.getField("KPI # 15 Rating").display = display.visible;

                this.getField("KPI # 15 Score").display = display.visible;

                this.getField("KPI # 15 Comment").display = display.visible;

                this.getField("KPI # 16 Rating").display = display.visible;

                this.getField("KPI # 16 Score").display = display.visible;

                this.getField("KPI # 16 Comment").display = display.visible;

                this.getField("KPI # 17 Rating").display = display.visible;

                this.getField("KPI # 17 Score").display = display.visible;

                this.getField("KPI # 17 Comment").display = display.visible;

                this.getField("KPI # 18 Rating").display = display.visible;

                this.getField("KPI # 18 Score").display = display.visible;

                this.getField("KPI # 18 Comment").display = display.visible;

                this.getField("KPI # 19 Rating").display = display.visible;

                this.getField("KPI # 19 Score").display = display.visible;

                this.getField("KPI # 19 Comment").display = display.visible;

                this.getField("KPI # 20 Rating").display = display.visible;

                this.getField("KPI # 20 Score").display = display.visible;

                this.getField("KPI # 20 Comment").display = display.visible;

                this.getField("KPI # 21 Rating").display = display.visible;

                this.getField("KPI # 21 Score").display = display.visible;

                this.getField("KPI # 21 Comment").display = display.visible;

                this.getField("KPI # 22 Rating").display = display.visible;

                this.getField("KPI # 22 Score").display = display.visible;

                this.getField("KPI # 22 Comment").display = display.visible;

                this.getField("KPI # 23 Rating").display = display.visible;

                this.getField("KPI # 23 Score").display = display.visible;

                this.getField("KPI # 23 Comment").display = display.visible;

                }

                • 5. Re: JavaScript Line Limits in Adobe Forms
                  try67 MVP & Adobe Community Professional

                  You can, yes, but make sure the quotes don't get screwed up... By the way,

                  this code can be condensed to about 4 lines by placing the names of the

                  fields in an array and looping over it.

                   

                   

                  On Wed, Jul 17, 2013 at 4:55 PM, Heather_Pennington <

                  • 6. Re: JavaScript Line Limits in Adobe Forms
                    Heather_Pennington Level 1

                    What?  That's a foreign language to me.  Can you explain in more detail or give an example?  thank you for your help!!!

                    • 7. Re: JavaScript Line Limits in Adobe Forms
                      try67 MVP & Adobe Community Professional

                      Something like this:

                       

                      var fields = ["Field1", "Field2", "Field3"]; // An array containing the names of the fields to process

                      if (event.value == "Select your name to begin the evaluation...") {

                           for (var i in fields) {

                                this.getField(fields[i]).display = display.visible;

                           }

                      }

                       

                      That's it. Just put the field names in the array and it would do the same as your entire code...

                      • 8. Re: JavaScript Line Limits in Adobe Forms
                        Heather_Pennington Level 1

                        This is what I have so far and I can't get it to work.  What am I doing wrong?

                         

                         

                        var A = ["KPI1Rating", "KPI1Score", "KPI1Comment", "KPI2Rating", "KPI2Score", "KPI2Comment", "KPI3Rating", "KPI3Score", "KPI3Comment", "KPI4Rating", "KPI4Score", "KPI4Comment", "KPI5Rating", "KPI5Score", "KPI5Comment", "KPI6Rating", "KPI6Score", "KPI6Comment", "KPI7Rating", "KPI7Score", "KPI7Comment", "KPI8Rating", "KPI8Score", "KPI8Comment", "KPI9Rating", "KPI9Score", "KPI9Comment", "KPI10Rating", "KPI10Score", "KPI10Comment", "KPI11Rating", "KPI11Score", "KPI11Comment", "KPI12Rating", "KPI12Score", "KPI12Comment", "KPI13Rating", "KPI13Score", "KPI13Comment", "KPI14Rating", "KPI14Score", "KPI14Comment", "KPI15Rating", "KPI15Score", "KPI15Comment", "KPI16Rating", "KPI16Score", "KPI16Comment", "KPI17Rating", "KPI17Score", "KPI17Comment", "KPI18Rating", "KPI18Score", "KPI18Comment", "KPI19Rating", "KPI19Score", "KPI19Comment", "KPI20Rating", "KPI20Score", "KPI20Comment", "KPI21Rating", "KPI21Score", "KPI21Comment", "KPI22Rating", "KPI22Score", "KPI22Comment", "KPI23Rating", "KPI23Score", "KPI23Comment"];

                        var B = ["KPI1Rating", "KPI1Score", "KPI1Comment", "KPI2Rating", "KPI2Score", "KPI2Comment", "KPI3Rating", "KPI3Score", "KPI3Comment", "KPI4Rating", "KPI4Score", "KPI4Comment", "KPI5Rating", "KPI5Score", "KPI5Comment", "KPI6Rating", "KPI6Score", "KPI6Comment", "KPI7Rating", "KPI7Score", "KPI7Comment", "KPI8Rating", "KPI8Score", "KPI8Comment", "KPI9Rating", "KPI9Score", "KPI9Comment", "KPI10Rating", "KPI10Score", "KPI10Comment"];

                        var C = ["KPI11Rating", "KPI11Score", "KPI11Comment", "KPI12Rating", "KPI12Score", "KPI12Comment", "KPI13Rating", "KPI13Score", "KPI13Comment", "KPI14Rating", "KPI14Score", "KPI14Comment", "KPI15Rating", "KPI15Score", "KPI15Comment", "KPI16Rating", "KPI16Score", "KPI16Comment", "KPI17Rating", "KPI17Score", "KPI17Comment", "KPI18Rating", "KPI18Score", "KPI18Comment", "KPI19Rating", "KPI19Score", "KPI19Comment", "KPI20Rating", "KPI20Score", "KPI20Comment", "KPI21Rating", "KPI21Score", "KPI21Comment", "KPI22Rating", "KPI22Score", "KPI22Comment", "KPI23Rating", "KPI23Score", "KPI23Comment"];

                        var D = ["KPI4Rating", "KPI4Score", "KPI4Comment", "KPI5Rating", "KPI5Score", "KPI5Comment", "KPI6Rating", "KPI6Score", "KPI6Comment", "KPI7Rating", "KPI7Score", "KPI7Comment"];

                        var E = ["KPI1Rating", "KPI1Score", "KPI1Comment", "KPI2Rating", "KPI2Score", "KPI2Comment", "KPI3Rating", "KPI3Score", "KPI3Comment", "KPI8Rating", "KPI8Score", "KPI8Comment", "KPI9Rating", "KPI9Score", "KPI9Comment", "KPI10Rating", "KPI10Score", "KPI10Comment", "KPI11Rating", "KPI11Score", "KPI11Comment", "KPI12Rating", "KPI12Score", "KPI12Comment", "KPI13Rating", "KPI13Score", "KPI13Comment", "KPI14Rating", "KPI14Score", "KPI14Comment", "KPI15Rating", "KPI15Score", "KPI15Comment", "KPI16Rating", "KPI16Score", "KPI16Comment", "KPI17Rating", "KPI17Score", "KPI17Comment", "KPI18Rating", "KPI18Score", "KPI18Comment", "KPI19Rating", "KPI19Score", "KPI19Comment", "KPI20Rating", "KPI20Score", "KPI20Comment", "KPI21Rating", "KPI21Score", "KPI21Comment", "KPI22Rating", "KPI22Score", "KPI22Comment", "KPI23Rating", "KPI23Score", "KPI23Comment"];

                         

                        if (event.value == "Select your name to begin the evaluation...")
                        {
                        for (var i in A)
                        {
                        this.getField(A[i]).display = display.visible;
                        }
                        }


                        else
                        if (event.value == "John Doe (Company)" || "Jane Doe (Company)")
                        {
                        for (var i in B)
                        {
                        this.getField(B[i]).display = display.visible;
                        }
                        for (var i in C)
                        {
                        this.getField(C[i]).display = display.hidden;
                        }
                        }


                        else
                        if (event.value == "Joe Blow (Company)")
                        {
                        for (var i in D)
                        {
                        this.getField(D[i]).display = display.visible;
                        }
                        for (var i in E)
                        {
                        this.getField(E[i]).display = display.hidden;
                        }
                        }

                        • 9. Re: JavaScript Line Limits in Adobe Forms
                          try67 MVP & Adobe Community Professional

                          I've answered you in the other forum where you posted the same question

                          under a different name...

                           

                           

                          On Fri, Jul 19, 2013 at 12:07 AM, Heather_Pennington <

                          • 10. Re: JavaScript Line Limits in Adobe Forms
                            Heather_Pennington Level 1

                            No, I did not post the same question in a different forum under a different name.  That is a co-worker of mine.  We are working on different forms but running into the same issues.

                            • 11. Re: JavaScript Line Limits in Adobe Forms
                              try67 MVP & Adobe Community Professional

                              OK, sorry, I had assumed you were the same person. Anyway, I answered there, so if you want you can join our discussion there.