How to Add Multiple CC Email Recipients in LiveCycle PDF Forms
Question details
The user needs to extract two distinct email addresses from form fields in a LiveCycle PDF and combine them to populate the CC line of an outgoing email.

- Product
- Adobe LiveCycle
- Device & OS
- not provided
- Scenario
- Configuring a custom email submission script in a dynamic PDF form to route copies of the form to multiple secondary recipients.
- Observed behavior
- Users mistakenly use the logical AND operator to separate email variables, which fails to create a valid, recognized email list for the email client.
Ensure you know the exact SOM expressions (hierarchy paths) for the form fields that contain the target email addresses before modifying the JavaScript.
Concatenate Email Variables with a Comma in JavaScript
Join the extracted variable values using a comma string separator so the email client recognizes them as distinct addresses.
When writing JavaScript for Adobe LiveCycle (XFA forms), using a logical AND (&&) operator will not correctly separate strings. The email client expects a single text string containing all addresses separated by commas.
To achieve this, you must use the plus (+) operator to concatenate the extracted email variables with a comma and an optional space in between.
Locate the exact nodes for the form fields containing the email addresses in your LiveCycle hierarchy.
Open your script editor and assign the first email to a variable using the resolveNode method. For example: var var1 = xfa.resolveNode("form1.CourseApplicationForm.Email").rawValue;
Assign the second email to another variable below the first one. For example: var var2 = xfa.resolveNode("form1.CourseApplicationForm.ApplicantEmail").rawValue;
Construct the CC string by concatenating the variables with a comma and space: cCc: var1 + ", " + var2

Effortlessly Manage and Share PDF Forms with WPS Office
While specialized tools like Adobe LiveCycle are required for advanced XFA JavaScript coding, you can easily view, fill, and share standard PDF forms using the lightweight and versatile WPS Office PDF editor.
- 1. Open WPS PDF: Launch WPS Office and open your PDF form using the built-in PDF viewer.
- 2. Fill the form fields: Click on the designated form fields to easily type in your data or applicant information.
- 3. Save the document: Go to the Menu and click 'Save As' to securely preserve your filled data.
- 4. Share via Email: Click the 'Share' or 'Email' button on the top toolbar to automatically attach the PDF to your default email client, where you can manually add multiple CC recipients.

Frequently Asked Questions
Why doesn't the logical AND (&&) operator work for multiple emails in a CC script?
The logical AND operator evaluates statements to a boolean value (true or false) rather than combining text strings. To send an email to multiple addresses, email clients require a single continuous string where addresses are separated by commas.
Can I use semicolons instead of commas to separate email variables?
While some desktop email clients like Microsoft Outlook accept semicolons, commas are the standard RFC format for mail-to links and email string generation. Using commas ensures maximum cross-client compatibility.
How do I prevent script errors if one of the email fields is left blank?
You can add a simple JavaScript 'if' condition to check if var1 or var2 is null or empty. If a field is blank, you can skip adding the comma and the empty variable to the final 'cCc' string, preventing hanging commas.




