Highlighted

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

New Here ,
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

13

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

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

New Here ,
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

14

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
Nov 17, 2020 0
Adobe Community Professional ,
Nov 17, 2020

Copy link to clipboard

Copied

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

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...
Nov 17, 2020 0
ls_rbls LATEST
Adobe Community Professional ,
Nov 17, 2020

Copy link to clipboard

Copied

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).

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