Skip to main content
Participant
December 8, 2016
Question

Pop-up Question

  • December 8, 2016
  • 2 replies
  • 381 views

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

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
December 8, 2016

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.

Joel Geraci
Community Expert
Community Expert
December 8, 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";