Copy link to clipboard
Copied
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".
Copy link to clipboard
Copied
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";
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now