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

help needed to email a form using multiple email addresses

shellm
Registered: Sep 27 2009
Posts: 20
Answered

Hi

I am using Livecycle 8.0 to create a Dynamic form.

I need to submit the form via email with an attached Pdf- this I have worked out however I need the email address to change based on what is chosen in a previous drop down field

i.e if the user chooses a department the submit email will choose the email address associated with it and open the outlook window.

does anyone have any ideas how to do this

thanks shellm

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
One possible method will look like this.
Put the JavaScript into the click event of a regular button.

var MyDepartmentAdress = ""; if (DropdownList.rawValue == "Department1"){MyDepartmentAdress = "<span class="spamspan"><span class="u">bob</span> [at] <span class="d">somewhere [dot] com</span></span>";}if (DropdownList.rawValue == "Department2"){MyDepartmentAdress = "<span class="spamspan"><span class="u">tom</span> [at] <span class="d">somewhere [dot] com</span></span>";}if (DropdownList.rawValue == "Department3"){MyDepartmentAdress = "<span class="spamspan"><span class="u">chris</span> [at] <span class="d">somewhere [dot] com</span></span>";} var myDoc = event.target;var address = MyDepartmentAdress;var sub = "Put in your mail subject here...";var msgBody = "Put in your mail message here...\n\nKind regards\n"; // \n is for line breaks myDoc.mailDoc({bUI: false,cTo: address,cSubject: sub,cMsg: msgBody,cSubmitAs: "PDF"});

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

shellm
Registered: Sep 27 2009
Posts: 20
Hi Radzmar

I put this code into the click action of a standard button and I don't get an error however it also doesn't do anything is there something missing or do I need a script on the dropdown menu to reference this

thanks shellm
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
No, you did everything right.
It was my fault.
There was a " to much in the code.
I corrected it, so it will work now as exspected.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

shellm
Registered: Sep 27 2009
Posts: 20
thanks this works now
shellm
Registered: Sep 27 2009
Posts: 20
Hi

I now need to add a subject line based on the Department choice can this be done.

Would it just be adding another variable for the subject line

thanks
shellm