Skip to main content
Participant
Jun 25, 2018 8:44 PM UTC
Answered

I need to be able to Submit a Form to email and add a CC address depending on a radio button choice

Here is what I have:

var cFormTitle = "CF Order Investigation: ";

var cAccountName = this.getField("Account Name").value;

var cAccountNumber = this.getField("Account Number").value;

var cToAddr = "qualityanalyst@test.com";

var cCCAddr = "salessupport@test.com";

if(this.getField("Radio1").value = "Yes") {

cCCAddr = "salessupport@test.com";

}

this.mailDoc({

bUI: true,

cTo: cToAddr,

cCCAddr: cCCAddr,

cSubject: cFormTitle + cAccountName + " - " + cAccountNumber;

})

When I try to select OK to save it, it gives me the error: SyntaxError: missing } after property list 13: at line 14

The output I would need is similar to this:

To: qualityanalyst@test.com

CC: if the Yes Radio button is selected I need this to auto fill to salessupport@test.com

Subject: CF Order Investigation: 123456 Test Account

Any help would be huge!!!  Thanks ahead of time guys

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jun 26, 2018 12:42 PM UTC

You used an incorrect parameter name. Change this;

cCCAddr: cCCAddr,

To:

cCc: cCCAddr,

6 replies

try67
Community Expert
Community Expert
Jun 25, 2018 9:12 PM UTC

Drop the semi-colon in the penultimate line.

Translate
karasheeAuthor
Participant
Jun 26, 2018 12:35 PM UTC

Okay and I did that but it's not inserting anything into the cc field on my email?

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jun 26, 2018 12:42 PM UTC

You used an incorrect parameter name. Change this;

cCCAddr: cCCAddr,

To:

cCc: cCCAddr,

Translate