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

submitForm() with HTML and POST method

riccarrasquilla
Registered: Sep 24 2008
Posts: 27

is there a way to use javascript submitForm () with HTML and the POST method?

here is the code I'm trying to get to work

var myDoc = event.target;
myDoc.submitForm({
cURL:"http://test.com/process.asp",
bGet:false,
cSubmitAs:"HTML"
});

i'm using a regular button because i need to use the click event for some validation code. the http button doesnt allow me to use a javascript. thx

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Unfortunately, submitting an XFA form (i.e. LiveCycle Form) with a HTTP Post doesn't do what you think, so it's not useable. Why not submit as XML?

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/]http://www.adobe.com/devnet/acrobat/[/url]

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

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
thomp wrote:
Unfortunately, submitting an XFA form (i.e. LiveCycle Form) with a HTTP Post doesn't do what you think...
What does it do?

George
riccarrasquilla
Registered: Sep 24 2008
Posts: 27
thanks for the answer. so, if i submit it via xml, would the receiving page have to parse the xml? i'm not that familiar with xml.

normally, i submit to an asp page and rip through the form or querystring collection (name/value).

im trying to get the user to supply his email in a dialog window, set a hidden text box to that validated value and submit to an asp page. the asp page would rip through the collection, send a notification email to the recepient with the collection information embedded into the email body (or email HTML body) and reply back to the sender with a confirmation email.

any ideas on how i can do this or point me in the right direction.

thanks again for the help

ric
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
George wrote:
What does it do?
I'm not really sure. A while ago (Acrobat 7) I did a series of pretty intensive tests on submitting data from an XFA form. The HTML options did something, but it didn't submit data. I figure that I missed something, such as an option or some kind of server hand shaking that needs to take place. But my take away was that this option is not a good choice.

riccarrasquilla wrote:
so, if i submit it via xml, would the receiving page have to parse the xml?
Yes. But, now-a-days many tools have built-in XML capabilities. XML is very popular and used everywhere. It would be well worth the effort to learn a bit about it. Depending on the language/platform, XML can be very easy to parse. I don't know about ASP, but ASP.NET has a great built-in XML parser.


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/]http://www.adobe.com/devnet/acrobat/[/url]

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

riccarrasquilla
Registered: Sep 24 2008
Posts: 27
how do you receive the xml when it is sent as part of the http stream? with a post or get you can parse the collection. is there a similar way to do that with the xml. im using asp and can't find anywhere that receives xml as a stream and parses it.

also, is there a way to cancel a form submit on a preSubmit() javascript and return to the filled form?

thx
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The submitted XML data will be in the body of the HTTP Request. The header fields contain information about the body, such as the number of bytes and the MIME type. There should be an ASP property of function for getting the body bytes. To make parsing the data easy make sure that you submit from Acrobat as UTF-8. The "submitAs" fucntion has a "cCharset" argument.

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/]http://www.adobe.com/devnet/acrobat/[/url]

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