Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2008-01-05 21:08:46

mpcweber
Member
Registered: 2008-01-05
Posts: 0

Need to programatically click a Submit button

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 Standard 8.1 / Windows

Offline

 

#2 2008-01-06 11:09:40

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Need to programatically click a Submit button

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.

Offline

 

#3 2008-01-06 20:21:50

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Need to programatically click a Submit button

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.

Offline

 

#4 2008-01-07 04:39:04

pddesigner
Member

Registered: 2007-04-24
Posts: 64

Re: Need to programatically click a Submit button

I just purchased the FDF Toolkit.net from http://nk-inc.com/software/fdftoolkit.net/

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);

Offline

 

#5 2008-01-06 17:17:46

mpcweber
Member
Registered: 2008-01-05
Posts: 0

Re: Need to programatically click a Submit button

What if you don't want to individually specify the form fields but instead pass all form values to a web application?

Offline

 

#6 2008-01-06 23:14:30

mpcweber
Member
Registered: 2008-01-05
Posts: 0

Re: Need to programatically click a Submit button

Yes I am building a .Net 2.0 web application that will receive the POSTed form variables.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

AcrobatUsers.com  >>  User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in