keep PDF form open after submit

I have created a complicated 3 page PDF form with a submit button. When the button is pressed the FDF file is sent to a PHP script on my webserver and is saved. This all works as it supposed to except when the submit button is pressed, the browser window changes and the PDF form is gone. If the user goes back to the PDF form, it is blank. If something goes wrong with the FDF upload, the user would have to fill in the PDF form all over again. Is there a way to keep the PDF form open in the browser after the FDF file is sent to my webserver?

I have tried placing:
echo “”;
as the first line in the PHP script. This does open a new tab but it is too late - it is after the browser switches to the new page.

I have tried placing:
window.open(’’,’_newtab’)
in the PDF file but Adobe does not support the window object.

I already have a popup that tells the user to print the form before sending it (and I have a print button on the form).

Well, a couple ways jump to mind…

If the PDF file is OPEN’d, in other words, you are at a site with a PDF opened such as “www.mysite.com/xyz.pdf” for an address, then there is no easy way to do this as you are INSIDE Adobe’s realm and MUST use whatever they give you for tools…
So, one way around this, put the PDF into an iFrame. In other words, your website page would be something like “www.mysite.com/MyPDFpage.html”. This page would then allow for Javascript to be used. One set up this way, you could change your button to call a Javascript function which could call your PHP code to do the saving and whatever. This processing PHP code could be done inside another opened window which would close itself when completed. (I suggest that the newly opened page say something like, “Saving new PDF to database…” or some notice. Then, when it is done saving, it would close itself and the message…
Hope that made sense… Good luck.

Sponsor our Newsletter | Privacy Policy | Terms of Service