2 Replies Latest reply on Jul 2, 2014 2:33 PM by DavetheBari

    Detecting a failed POST communication in a Form's javascript

    DavetheBari Level 1

      My PDF form has a 'Submit' button that is a standard button with Javascript responding to the button's 'Mouse Up' event.

      The Javascript calls the function 'submitForm', and this results in a POST to a website who's URL is written into the form's js code.

      A POST can fail to achieve the desired communication through no fault of the form, its js code or the Adobe Reader in which the form is being hosted. For instance a simple communication break or lots of noise will cause such a failure. Adobe Reader certainly detects the occurrence of an unsatisfactory response to the POST, as it advises the user via a simple 'alert' dialog.

      The function 'submitForm' returns 'true', regardless of the condition of the communication. ( I have never seen this stated, but my testing indicates that the return of 'true' is not affected by any communication failure.)

      I need the code behind the form to be advised of a POST communication failure, so that it can make a particular adjustment to the form. Presumably this would be achievable by use of an event listener, but I cannot find any information on a hookable event in Adobe Reader that is related to such a failure. Does anyone have any ideas?

        • 1. Re: Detecting a failed POST communication in a Form's javascript
          try67 MVP & Adobe Community Professional

          That is not possible. However, I believe you can return (from your

          web-server) an FDF file, which is then displayed in the application. So you

          could add an alert before the submitForm that says that the file is only

          successfully received if you see a web that say "Thank you for submitting

          the file.". If the process fails, the user won't see that page, and if it

          works it will show an FDF with that message that it got from your server.

           

           

          On Wed, Jul 2, 2014 at 8:06 AM, DavetheBari <forums_noreply@adobe.com>

          • 2. Re: Detecting a failed POST communication in a Form's javascript
            DavetheBari Level 1

            Hi Gilad.

            Thank you for your response, even though is not what I wanted to hear!!!!

            Currently, the recipient website does respond by causing the acknowledgment to be displayed. As I said, Reader detects a communication failure, and advises the user. So the suggested alert from the form would just be redundant. It is not the user that I am concerned about, it is getting the information to the javascript.