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

submit a form using http post like method using javascript code

sankett
Registered: May 2 2008
Posts: 9

Hi,

We have a pdf form with fillable fields and a SAVE button. When a user clicks SAVE button, we would like to have a http post like submission to a particular url. This page will be a server-side page which will do some action depending on what the user has submitted.

In Acrobat Professional, the following javascript code works:
function submit()
{
var url = this.URL;
var pieces = url.split("/");
pieces[pieces.length-1] = "save.php";
url = pieces.join("/");

this.submitForm(
{cURL: url,
bCanonical: true,
cSubmitAs: "HTML"}
);
}
submit();

In Adobe lifecycle, I am still not sure how it will have to be changed. I know that it can be done in using a button of "control type: Submit", but I want to see it working with javascript. Any help will be appreciated.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=14107

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