10 Replies Latest reply: Nov 10, 2014 9:16 AM by George Johnson RSS

    Javascript fails to start

    Gamnel977 Community Member

      I am using Acrobat 9 to develop a form and interactive Javascipt routine.  At Acrobat startup the routine no longer runs.  In javascript debugger I get for example the error message

        "ReferenceError: EnableSignature is not defined 1:Field:Blur"

      This happens for all document level functions.  If I open the document function to edit it and close again all functions then work normally. 

      The problem appears to be with Acrobat or its settings because I have the same problem using a version of the form archived a month ago.  This version was working at the time it was archived..

        • 1. Re: Javascript fails to start
          Gilad D (try67) CommunityMVP

          This generally means that you're referring to a function or a method that

          doesn't exist. It's very hard to say what exactly is going on without

          seeing the actual file and the code used in it.

          • 2. Re: Javascript fails to start
            Gamnel977 Community Member

            The function exists.  Simply opening any function to edit it and closing again restores functionality to all of them.  The problem seems to be that Acrobat does not recognise the existence of the JavaScript code.

            • 3. Re: Javascript fails to start
              Gilad D (try67) CommunityMVP

              Where does it exist, though? If in a doc-level script that that's a

              problem. If you want to share it between documents it needs to either be

              embedded in all of them, or at a folder-level script.

               

              On Mon, Nov 10, 2014 at 10:56 AM, Gamnel977 <forums_noreply@adobe.com>

              • 4. Re: Javascript fails to start
                Gamnel977 Community Member

                The code is embedded in the form.  When Acrobat first opens the form does not respond correctly to input data.

                Going to 'Advanced' - 'Document Processing' - 'Document Javascripts' displays the dialog box with the list of all document level functions.

                Closing the dialog box without doing anything else clears the problem.

                This problem first occurred a couple of days ago and it has affected all versions of the form I've tried.

                I have multiple backup copies of the form, each time I save I change the file name.  All have code embedded in them.

                Once functionality is restored to any version of the form then its OK for all other forms whether it was already open or if it is subsequently opened.

                When Acrobat is closed and reopened it is then necessary to again open the Javascript Functions dialog box before normality is restored

                I can open a Reader Enabled version in Reader XI and it works fine.  Opening the same file in Acrobat and there is no functionality.

                • 5. Re: Javascript fails to start
                  Test Screen Name CommunityMVP

                  But when Acrobat opens there is no form, no current data. Perhaps you are assuming that if Acrobat isn't running and you double click on a file the order will be

                  - open document

                  - Acrobat startup scripts

                  - document level scripts

                   

                  No, it is

                  - Acrobat startup scripts

                  - open document

                  - document level scripts

                  • 6. Re: Javascript fails to start
                    Gamnel977 Community Member

                    Yes I understand what you say but the problem is after that

                    -Open Acrobat

                    -Open File - form displays but I have no script is activated during file open

                    -Enter data in any field - expected action does not happen and if JavaScript debugger is opened then the Not Defined error is present

                     

                    If instead

                    -Open Acrobat

                    -Open File

                    -Open JavaScript Functions dialog and close it

                    -Enter data in any field - works as expected

                    • 7. Re: Javascript fails to start
                      Gilad D (try67) CommunityMVP

                      You need to share the file.

                       

                      On Mon, Nov 10, 2014 at 12:47 PM, Gamnel977 <forums_noreply@adobe.com>

                      • 8. Re: Javascript fails to start
                        Gamnel977 Community Member

                        I've uploaded file  - NFoW Boats e-Form V8.1 Beta.pdf

                        I've included the name of this thread as a description.

                        • 9. Re: Javascript fails to start
                          Gilad D (try67) CommunityMVP

                          You can't upload files here directly. You need to upload them to a file-sharing website and then post the link.

                          • 10. Re: Javascript fails to start
                            George Johnson CommunityMVP

                            I think you're right that it has something to do with your installation and not the file. You can confirm this by testing on another system or maybe Reader. Do any errors show up in the JavaScript console if you start Acrobat without loading a file and press Ctrl+J? If not, what about if you then open the file using: File > Open

                             

                            You might want to see if doing a repair (Help > Repair Acrobat Installation) helps. Also, exactly which version of Acrobat 9 are you using? The latest is 9.5.5.