Highlighted

Required Field Alert upon submission email subject

Explorer ,
Sep 15, 2020

Copy link to clipboard

Copied

Hi,

I have been using the below code 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 please.

Thanks in advance

Paul

 

// This is the form return e-mail. Its hardcoded // so that the form is always returned to the same address // Change address on your form var cToAddr = "Colette.Williams@sjp.co.uk"; var cCCAddr = "" // Set the subject and body text for the e-mail message var cSubLine = "St. James's Place PC Consultancy Request Form"; var cBody = ""; 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
PDF forms

Views

41

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

Required Field Alert upon submission email subject

Explorer ,
Sep 15, 2020

Copy link to clipboard

Copied

Hi,

I have been using the below code 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 please.

Thanks in advance

Paul

 

// This is the form return e-mail. Its hardcoded // so that the form is always returned to the same address // Change address on your form var cToAddr = "Colette.Williams@sjp.co.uk"; var cCCAddr = "" // Set the subject and body text for the e-mail message var cSubLine = "St. James's Place PC Consultancy Request Form"; var cBody = ""; 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
PDF forms

Views

42

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
Sep 15, 2020 0
try67 LATEST
Most Valuable Participant ,
Sep 27, 2020

Copy link to clipboard

Copied

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...
Sep 27, 2020 0