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

How do I concatenate two getField() values in this.mailDoc() cSubject property

New Here ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

I can't figure out how to concatenate a set of values in the subject section in the mouse up action on the submit button of a form.

 

This is what I have so far, but it doesn't work as expected:

this.mailDoc({cTo: "email@email.com", cSubject: this.getField("Location").valueToString ": " + "Booking for " + this.getField("host").valueToString + " at " + this.getField("Time") + " " + this.getField("Date").valueToString});

TOPICS
Create PDFs

Views

283

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 , Nov 17, 2020 Nov 17, 2020

Try it like this:

 

this.mailDoc({cTo: "email@email.com", cSubject: this.getField("Location").valueAsString+ ": " + "Booking for " + this.getField("host").valueAsString+ " at " + this.getField("Time").valueAsString + " " + this.getField("Date").valueAsString});

 

You were missing a few things in your original script.

 

Also make sure that the field names in your script match the actual field name (they must be spelled the same or the script will hang because it won't find the field object).

Votes

Translate

Translate
Community Expert ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

Have you tried by rephrasing "valueToString" to ".valueAsString"?

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 ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

LATEST

Try it like this:

 

this.mailDoc({cTo: "email@email.com", cSubject: this.getField("Location").valueAsString+ ": " + "Booking for " + this.getField("host").valueAsString+ " at " + this.getField("Time").valueAsString + " " + this.getField("Date").valueAsString});

 

You were missing a few things in your original script.

 

Also make sure that the field names in your script match the actual field name (they must be spelled the same or the script will hang because it won't find the field object).

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