Hi, Marcelo.
That one is quite simple.... All you gotta do is to create the basic Action fields on your form and to script a submit button as follows:
1 - Create a hidden form field called JFWF_PDFINFO;
2 - Create the action list box called JFWF_ACTION;
3 - Create a button, which will run a JavaScript on the MouseUP event.
Here's the secret:
When you create a PDF form outside the Designer (e.g. using MS Word and Acrobat 6.0, for an instance) you have to customize the script for the Submit button. This is an example of a script that should be run on the MouseUP event of your submit button:
var boEnvia = true;
var oPDFInfoField = this.getField("JFWF_PDFINFO");
var aPDFInfo = oPDFInfoField.value.split(";");
var sTargetURL = "";// first element is the URL to post to
var sCleared = "";
var sRadioButtons = "";
if (boEnvia){
// see if potential checked checkboxes have been cleared
for (var i = 1; i < aPDFInfo.length; i++) {
var aNameValue = aPDFInfo[i].split("=");
var sName = aNameValue[0];
var sValue = aNameValue[1];
if (sName == "XFIELDS") {
var aFieldNames = sValue.split(",");
for ( var x = 0; x < aFieldNames.length; x++) {
var oField = this.getField(aFieldNames[x]);
if (oField != null && oField.type == "checkbox" && !oField.isBoxChecked(0)) {
if (sCleared == "")
sCleared = ";UNCHECKED=" + aFieldNames[x];
else
sCleared += "," + aFieldNames[x];
}
}
}
else if (sName == "TARGETURL")
sTargetURL = sValue;
}
// Save radio button names...
for (var x = 0; x < this.numFields; x++) {
if (this.getField(this.getNthFieldName(x)).type == "radiobutton") {
if (sRadioButtons == "")
sRadioButtons = ";RB=" + this.getNthFieldName(x);
else
sRadioButtons += "," + this.getNthFieldName(x);
}
}
if (app.viewerVersion < 6) {
oPDFInfoField.value += "ENCODING=PDFDocEncoding" + sCleared + sRadioButtons
this.submitForm( sTargetURL,
false, // HTML form
true, // Post all fields (true), or do Not post all fields (false)
null,
false, // Use post method (false)
false); // For forms, do not submit annotations
}
else{
oPDFInfoField.value += "ENCODING=UTF-8" + sCleared + sRadioButtons;
this.submitForm({cURL: sTargetURL,
bEmpty: true, // Post all fields (true), or do Not post all fields (false)
cSubmitAs: "HTML", // Post URL-Encoded
cCharset: "utf-8"});
}
}
I´m sending you a form that I used to test e-mail notifications here at MCR... By the way, could some one help me on the topic I just posted? Can´t get the Agent to connect properly to an e-mail server.
Thanks.