Answered
I have reviewed forum examples and am having difficulty with this issue. I am using Acrobat 9 Pro and “Extending Features in Adobe Reader”. The user would fill out the form and then submit the completed form as a pdf document attachment to an e-mail address. I would like the Subject Header populated with a user-completed text field labeled “Item Number”.
I am trying to use the following in a Mouse Up JavaScript in a submit button and the JS Editor gives a message “missing ) after argument list 2: at line 3…Ln 4, Col 4”
var b = this.getField("subject");
this.submitForm("mailto:Name [at] Company [dot] com?"
+ "&subject=" + encodeURI(b.value)
);
I would appreciate your help.
var address = user [at] somewhere [dot] com
var sub = this.getField("ItemNumber").value;
var msgBody = "Attached is the Return Authorization form.";
////message box with instructions to add email addresses
var cResponse = app.alert({
cMsg: "To email this form, select email addresses from the EMAIL FORM TO list. Hold CTRL to select multiple addresses. \n\nYou will be able to add other email addresses after you click YES.\n\nProceed?\n\nClick YES to proceed.\nClick NO to go back and select addresses.",
nIcon: 2, nType: 2,
cTitle: "Email Form"});
// proceed only if response is "YES"
if (cResponse == 4) {
this.mailDoc({
bUI: false,
cTo: address,
cSubject: sub,
cMsg: msgBody,
cSubmitAs: "PDF"
});
}
By the way, I have noticed that when you get the "missing )" error, it usually means that you left out something and that omission is causing the javascript to be interpreted incorrectly. So check all your, commas, quotation marks, parenthesis, and the like.