2 Replies Latest reply on Dec 8, 2016 8:11 AM by try67

    Pop-up Question

    michellearc

      I have a form with a Submit button.  Can I create a pop-up message that appears when the form is submitted to say something like, "Thanks.  Your form has been submitted".

        • 1. Re: Pop-up Question
          Joel_Geraci Adobe Community Professional

          Yes.

           

          Typically - After sending the data to a server, I send an FDF back to the PDF with a success or failure message by using /JavaScript /After which runs the JavaScript after the FDF has been imported. In PHP, it looks like what you see below but you can adjust the code to whatever language you need.  The variable $reponseText is what you'd set depending on the success or failure of the submission.

           

          By making the server respond, you can be sure the data was recorded before telling the user that it actually has.

               $reponseText = "Your form has been submitted. 
               header("content-type: application/vnd.fdf");     
               header('Content-Disposition: attachment; filename="response.fdf"');           
               echo "%FDF-1.2 " . chr(0x0D) . chr(0x0A) . "1 0 obj << /FDF << /JavaScript << /After (app.alert('";     
               echo $responseText;     
               echo "');) >> >> /Type/Catalog>>endobj trailer << /Root 1 0 R >> %%EOF";
          • 2. Re: Pop-up Question
            try67 MVP & Adobe Community Professional

            Yes, but if you want this message to only appear if the form data was actually received on your end then you would need to set up a service running a web-server, instead of using email.