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});
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).
Copy link to clipboard
Copied
Have you tried by rephrasing "valueToString" to ".valueAsString"?
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).