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

New Here ,
Jun 25, 2018

Copy link to clipboard

Copied

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

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

You used an incorrect parameter name. Change this;

cCCAddr: cCCAddr,

To:

cCc: cCCAddr,

TOPICS
Acrobat SDK and JavaScript, Windows

Views

136

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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

New Here ,
Jun 25, 2018

Copy link to clipboard

Copied

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

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

You used an incorrect parameter name. Change this;

cCCAddr: cCCAddr,

To:

cCc: cCCAddr,

TOPICS
Acrobat SDK and JavaScript, Windows

Views

137

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 25, 2018 0
Most Valuable Participant ,
Jun 25, 2018

Copy link to clipboard

Copied

Drop the semi-colon in the penultimate line.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 25, 2018 0
New Here ,
Jun 26, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 26, 2018 0
Most Valuable Participant ,
Jun 26, 2018

Copy link to clipboard

Copied

You used an incorrect parameter name. Change this;

cCCAddr: cCCAddr,

To:

cCc: cCCAddr,

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 26, 2018 0
New Here ,
Jun 26, 2018

Copy link to clipboard

Copied

That worked perfect except when I select the No radio button it still inserts the salessupport@test.com into my cc field.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 26, 2018 0
Most Valuable Participant ,
Jun 26, 2018

Copy link to clipboard

Copied

Change:

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

To:

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 26, 2018 0
try67 LATEST
Most Valuable Participant ,
Jun 26, 2018

Copy link to clipboard

Copied

Also, that condition doesn't make much sense. If you want it to work you need to define cCCAddr as a blank string, before the condition.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 26, 2018 0