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

Custom Subject line in Java Script

New Here ,
Apr 30, 2020 Apr 30, 2020

Copy link to clipboard

Copied

I built a button on a form to email the entire .pdf back for review. I figured out how to program the button to execute a Java script that will pull data from a field and display it in the Subject line of the email.

var mySubject=this.getField("Traveler Name").value;

this.mailDoc({bUI: true, cTo: "corporate.security@mycompany.com", cSubject: mySubject})

What I can't seem to figure out is how to edit the script to include the text, "Business Essential Travel Request from: " to precede the [Traveler Name] field in the Subject line:

 

PS: I have NO Java KSA's.

TOPICS
Acrobat SDK and JavaScript

Views

756

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 , Apr 30, 2020 Apr 30, 2020

In JavaScript, Text is concatonated just like numbers are added.

 

var mySubject= "Business Essential Travel Request from: " + this.getField("Traveler Name").value;

Votes

Translate

Translate
Community Expert ,
Apr 30, 2020 Apr 30, 2020

Copy link to clipboard

Copied

In JavaScript, Text is concatonated just like numbers are added.

 

var mySubject= "Business Essential Travel Request from: " + this.getField("Traveler Name").value;

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
New Here ,
Apr 30, 2020 Apr 30, 2020

Copy link to clipboard

Copied

var cSubLine = "Business Essential Travel Request for " + this.getField("Traveler Name") .value;
this.mailDoc({bUI: true, cTo: "corporate.security@mycompany.com", cSubject: cSubLine})

 

thoughts?

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
Community Expert ,
Apr 30, 2020 Apr 30, 2020

Copy link to clipboard

Copied

Do you have a question?

The code looks good.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
New Here ,
May 01, 2020 May 01, 2020

Copy link to clipboard

Copied

LATEST

No, sorry! No question- just wanted confirmation the code was sound.  Thanks for your time!

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