These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Copy entry from drop down list into email subject line.

minnesota_slim
Registered: Dec 5 2008
Posts: 5

Help! I am using “mailto:” in the "Submit to URL:" field in a submit button to open an email with the filled out PDF attached when “SUBMIT” is selected.
I also use “?Subject=xxxx” in the "Submit to URL:" field to populate the email subject line with with text “xxxx”.
Instead, I want to copy an entry from a drop down list into the email subject line when “SUBMIT” is selected.
Is this possible? I have searched the forums and can’t find an answer.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Yes, it's poosible.

Here is a script I'm using for sending mails with customized parameters.
You have to use it with a button on the mouse up oder click event.
Don't use the general mail button for this and remember to enable user rights for the PDF.

**************************************************************
// Variables to be used in the mail context
var myDoc = event.target;
var address = "name [at] domain [dot] net";
var sub = "This mail was returned by ";
var msgBody = "Hello,\n\nSee my PDF attached.\n";
var Sender = Form1.Page1.Header.Sender.rawValue;

// Send mail action
myDoc.mailDoc({
bUI: false,
cTo: address,
cSubject: sub + Sender,
cMsg: msgBody + "\n\nKind regards\n" + Sender,
cSubmitAs: "PDF"
});
**************************************************************

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

minnesota_slim
Registered: Dec 5 2008
Posts: 5
Thank you. I am afraid I am a beginning user and I know nothing about scripts. If you had a suggestion for a document or site where I could learn how to implement your solution, I would be grateful.
However, I am not sure that it solves my problem. Perhaps I was unclear.
I am in an unusual situation, I have 6 people that need to review returned forms by category. I have a drop down list of categories in the form. I want the category chosen in the drop down list in the form to appear in the form submission email, (thus identifying which of the 6 responders should work on which “returned form” email).
How can I “capture” the category chosen in the drop down list and populate the email subject line with it? Could the script solution do that?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Well, there are too many sources to find knowledge about PDF and JavaScript.
Have a look at the tutorials in this forum first, there you can find many solutions.
But for testing you only have to create a new form with a dropdown box and a button where you put the JS to the click oder mouse up event.
Be shure to set it script editor to JavaScript.

In my example you find this lines
**************************************************************
var Sender = Form1.Page1.Header.Sender.rawValue;
....
cSubject: sub + Sender,
**************************************************************

You only have to modify them for your mail subject needs like this.

**************************************************************
/ Variables to be used in the mail context
var myDoc = event.target;
var address = "name [at] domain [dot] net";
var msgBody = "Hello,\n\nSee my PDF attached.\n";
var Category = Form1.Page1.Dropdown.rawValue;

// Send mail action
myDoc.mailDoc({
bUI: false,
cTo: address,
cSubject: Category,
cMsg: msgBody + "\n\nKind regards\n" Your name,
cSubmitAs: "PDF"
});
**************************************************************

In this case the variable "Category" will have that entry you have choosen from the dropdown box when you click the button.
After that your mail application should pop up with a new mail and the customized subject line.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs