hello,
I have created a form which contains checkboxes. Each checkbox will represent an e-mail address. When the checkbox is checked, I would like the email address to be CC to the email. When the checkbox is deselected, I would like it to be removed from CC. I am having problems coding it. When the checkbox is deselected the CC address is set to default, I receive the following error: Microsoft Office Outlook does not recognize "". I am deciding the form in Adobe Livecycle. The checkbox does add the email address. How can add multiple checkboxes and avoid the Outlook error message? Can anyone help me clear up the code?
The following is the code I have written.
var gaemail = "jr [at] abz [dot] com, jc [at] abz [dot] com, mc [at] abz [dot] com, "; //default email addresses
if (Fleetsheet.rawValue == 1 ) //if the checkbox is true is will add the below recipient to CC.
{
var flmail = "jo [at] abz [dot] com";
}
if (Fleetsheet.rawValue == 0) // if the checkbox is false it will remove the recipient from CC. I receive an Outlook error.
{
var flmail = gaemail;
}
event.target.mailDoc({
cTo: "itsupport [at] abz [dot] com",
cCc: "jr [at] abz [dot] com, jc [at] abz [dot] com, mc [at] abz [dot] com, " + flmail,
cSubject: NewEmployee.rawValue + " - " + Subform1.Subject.rawValue,
cMsg: "Please review the attached document. \n\nThank you,\nHuman Resources",
cSubmitAs: "PDF",
cCharset: "utf-8"
});
Thanks for your help,
CM
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script