Skip to main content
Participant
June 1, 2016
Question

Can I add free text to 'this getfield' javascript command in subject of email?

  • June 1, 2016
  • 1 reply
  • 480 views

I am very new to Javscript and have set up a PDF form with 2 submit buttons. The 1st button is set to send an email to a Manager to give their approval for a docuemnt. I have set a 'this getfield' command to the subject line in the email but I want to add free text to the start of the subject line saying "FOR APPROVAL" then to pull from the 'title of document' field.  This is the code that I have used and it works

var cSubLine= this.getField("Title of document").value;

The person who helped me set up the javascript in the first place has now left so I am the only one doing it so please excuse my ignorance, I have not had any training but I am very keen to learn this and a very quick learner.

This topic has been closed for replies.

1 reply

Inspiring
June 1, 2016

Sure, just do something like:

var cSubLine = "FOR APPROVAL " + this.getField("Title of document").valueAsString;

Participant
June 1, 2016

That has worked so thank you! I knew it wasn't something difficult but didn't know where to start! I am trying to find a list of JavaScript commands that I can print off and have as a reference but can't seem to find them, do you know where I could find that information?