These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Submitting a form to URL opens new window

jeremyb1
Registered: Aug 6 2009
Posts: 8
Answered

I'm using the "Submit a form" action to send form fields via HTML to a php script however after submitting the form acrobat acknowledges the transfer by opening a new window w/ a blank document.

The php script returns no data, I've even tried forcefully terminating the TCP/IP connection after receipt of data however I still get a blank document. The only workaround I've come up with is to return 404 File Not Found, which returns a different (less annoying) notification.

Is there anyway to change the default behavior of Acrobat to submit the fields via HTML to the php script and simply display a message box saying "Submit Successful".

Perhaps a javascript command to send each variable as a POST command?

Thanks in advance.

My Product Information:
Acrobat Pro 9.1.3, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
If the PHP script doesn't return anything then how would Acrobat know the submit was successful? All HTTP operations have two sides, a Request and a Response. The Request is sent by the client, in this case Acrobat. The request is recieved by the server script, which process the request data and then sends a response. By default, PHP always sends an HTML response. Even if your PHP script does nothing, the PHP engine sends some token HTML code back. That's just the way it works.

When Acrobat recieves HTML back from a submit it thinks the server is sending an info page, possibly something useful about the submit, so it opens a browser window.

But the proper way for sever script to handle a request from Acrobat is to return Acrobat data. What I usually do is to return a simple FDF block containing a script which displays a popup message letting the user know the status of the submit. It Acrobat does not recieve anything back it assumes there was an error. So you must return somthing from the server.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

jeremyb1
Registered: Aug 6 2009
Posts: 8
Thanks, worked like a charm.

For future readers.

Used FDF in example 1.3
http://www.math.uakron.edu/~dpstory/tutorial/pdfmarks/acro5new.pdf

Make sure you send the FDF content type first
http://us3.php.net/manual/en/function.fdf-set-on-import-javascript.php

header('Content-type: application/vnd.fdf');


Also if you send the FDF content type w/ no FDF attached it won't popup a new window..