Adding Subject Line text to Javascript code

Explorer ,
Sep 16, 2020 Sep 16, 2020

Copy link to clipboard

Copied

Hi,

I have been using the below code, which I found on this community, to alert required fields which works fine when all is good and the email pops up it is missing the subject line, can anyone help with the Javascript to add text to the Subject Field

 

Thanks in advance

Paul

 

var emptyFields = []; for (var i=0; i<this.numFields; i++) { var f= this.getField(this.getNthFieldName(i)); if (f.type!="button" && f.required ) { if (f.defaultValue==f.valueAsString) emptyFields.push(f.name); } } if (emptyFields.length>0) { app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n")); } else this.mailDoc({cTo: "Colette.Williams@sjp.co.uk"});

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

101

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
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Sep 16, 2020 Sep 16, 2020
Change this: {cTo: "Colette.Williams@sjp.co.uk"} To: {cTo: "Colette.Williams@sjp.co.uk", cSubject: "Message subject goes here"}

Likes

Translate

Translate
Adobe Community Professional ,
Sep 16, 2020 Sep 16, 2020

Copy link to clipboard

Copied

Change this:

{cTo: "Colette.Williams@sjp.co.uk"}

To:

{cTo: "Colette.Williams@sjp.co.uk", cSubject: "Message subject goes here"}

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
community guidelines
Explorer ,
Sep 16, 2020 Sep 16, 2020

Copy link to clipboard

Copied

LATEST

Thats Brilliant much appreciated as always

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
community guidelines