• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
15

PDF Form javascript submission - email format

Explorer ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

I suspect this is out of my control but I'm being told by end user that when they try to submit the form the email that's popping up is in plain text but they need it to generate in html format - this is primarily so that the user signature adds automatically (assuming it is set up that way) to the email.

Is there any way to do this? Or is it a local setting I can't affect?

The code attached to the submit button checks required fields then, assuming they're complete, creates email, cc'ing up to two people who add their details to the form:

var requiredFields = new Array();
for (var i = 0; i < this.numFields; i++)
{
var fName = this.getNthFieldName(i);
var f = this.getField(fName);
if (f.type!="button" && this.getField(fName).required && (this.getField(fName).value == null || this.getField(fName).value == ''))
{
requiredFields[requiredFields.length] = fName;}}
var error = "Please complete the following fields: \n\n";
for (j=0; j < requiredFields.length; j++)
{
if (requiredFields[j].value == null)
{
error = error + requiredFields[j] + '\n';
var f2 = this.getField(requiredFields[j]);
f2.setFocus();
}

}

if (requiredFields.length > 0) {
app.alert(error);
} else {

var cToAddr = "email@companyname.co.uk";
var cCCAddr = this.getField("Email1").value;
var cArAddr = this.getField("Email2").value;
if(cArAddr != "")
cCCAddr += ";" + cArAddr;
var cSubLine = "New request form";
var cBody="Generic message here.";


this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine,cMsg:cBody});
}

TOPICS
JavaScript , PDF , PDF forms

Views

154

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

Community Expert , Mar 13, 2024 Mar 13, 2024

Not possible. A script can only generate a plain-text email message. If you include HTML tags in it maybe the email application you use will interpret it as an HTML page, but it's not guaranteed.

Votes

Translate

Translate
Community Expert ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

Not possible. A script can only generate a plain-text email message. If you include HTML tags in it maybe the email application you use will interpret it as an HTML page, but it's not guaranteed.

Votes

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 ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

LATEST

Thanks for speedy response!

Votes

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