Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Pop-up Question

New Here ,
Dec 08, 2016 Dec 08, 2016

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

TOPICS
Acrobat SDK and JavaScript
324
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2016 Dec 08, 2016

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";
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2016 Dec 08, 2016
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines