Javascript issue with submitForm
My form has a button with a javascript associated to the Mouse Up event.
The script code follows:
if (FormOk()==true) {
//Confirmation request
var nButton = app.alert({
cMsg: "Do you want to submit this application form?",
cTitle: "Submit form", nIcon: 2, nType: 2});
if ( nButton == 4 ) {
//Form collection email address
cToAddr = "mailbox@example.com";
// Set the subject and body text for the email message
var cSubLine = "Application for Employment";
// Set the subject and body text for the email message
var cBody = "Instructions to handle this application form:\n" +
"1. Double-click the attachment\n" +
"2. Select a response file";
//Build email URI
var cURI = encodeURI("mailto:" + cToAddr + "?" +
"subject="+ cSubLine + "&body=" + cBody);
//Exception handling
try {
//Submit form by email
this.submitForm({cURL: cURI, cSubmitAs: "PDF"});
app.alert({
cMsg: "Your application has been submitted",
cTitle: "Submit form", nIcon: 3});
} catch(e) {
//Display error info
app.alert({
cMsg: "Application NOT submitted\n\n" +
e.name + " on line: " + e.lineNumber +
"\n\n" + cURI});
}
} else {
app.alert({
cMsg: "Your application WAS NOT submitted",
cTitle: "Submit form", nIcon: 3});
}
}
This should work as per the documentation but it is not and it is driving me crazy.
The issue happens using my Outlook mail client and also using Gmail webmail client.
I would appreciate any ideas about how to solve this issue.
Thanks in advance!
