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

Need to programatically click a Submit button

mpcweber
Registered: Jan 5 2008
Posts: 7

I need to be able to programatically click a Submit button in a Acro Form. The submit button is configured to submit the form data to a web application.

My Product Information:
Reader 8.0999999999999996447286321199499070644378662109375, Windows
pddesigner
Registered: Jul 9 2006
Posts: 858
These examples are not specific to a particular web application but will submit data to your web server. Change "myserver" to your URL.

Example 1
Submit the form to the server.

this.submitForm("http://myserver/cgi-bin/myscript.cgi#FDF");


Example 2

var aSubmitFields = new Array( "name", "id", "score" );
this.submitForm({
cURL: "http://myserver/cgi-bin/myscript.cgi#FDF",
aFields: aSubmitFields,
cSubmitAs: "FDF" // the default, not needed here
});

Example 3

A form is submitted to a server using a SOAP-based invocation.


// Populate the content object with form and SOAP information:
var location = "http://myserver/parentfolder/subfolder1/subfolder2/"
var formtype = location + "encodedTypes:FormData";
var content = new Array();
for(var i = 0; i < document.numFields; i++) {
var name = document.getNthFieldName(i);
var field = document.getField(name);
content[i] = new Object();
content[i].soapType = formtype;
content[i].name = field.name;
content[i].val = field.value;
}
// Send the form to the server:
SOAP.request({
cURL: cURL,
oRequest: {
location + ":submitForm":
{
content: content
}
},
cAction: location + "submitForm"
}

Hope this helps.

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

pddesigner
Registered: Jul 9 2006
Posts: 858
Not knowing the "web application" configuration and programming language, I'll not be able to help you with this problem. If your web application is using an asp.net. HTML, or Flex application file, I may be able to help.

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

pddesigner
Registered: Jul 9 2006
Posts: 858
I just purchased the FDF Toolkit.net from [url=http://nk-inc.com/software/fdftoolkit.net/]http://nk-inc.com/software/fdftoolkit.net/[/url]

It could be a tool you can use of future PDF to .net development. Take a look.

Try this code for your submit button:

To submit PDF form data to ASP

var asp_url = "http://your.domain.com/webpage.asp#FDF";

// FDF Format
this.submitForm(asp_url,true,true);

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

mpcweber
Registered: Jan 5 2008
Posts: 7
What if you don't want to individually specify the form fields but instead pass all form values to a web application?
mpcweber
Registered: Jan 5 2008
Posts: 7
Yes I am building a .Net 2.0 web application that will receive the POSTed form variables.