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

Modify Submit button to pick up email address fromLiveCycle form field

jsaynavong
Registered: Oct 12 2006
Posts: 12

When a user clicks on Send Confirmation button (via email), I would like to have the To line automatically filled out using the "EmailAddress" field on the form. How do I modify the button on a LiveCycle form? Thank you in advance for any reponses.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

you need a to create a customized mail button from a general button.
The JavaScript for the click:event of this button could look like:
  1. var MyMailAddress = FormField123.rawValue;
  2. var myDoc = event.target;
  3. var address = MyMailAddress;
  4. var sub = "Put in your mail subject here...";
  5. var msgBody = "Put in your mail message here...\n\nKind regards\n"; // \n is for line breaks
  6.  
  7. myDoc.mailDoc({
  8. bUI: false,
  9. cTo: address,
  10. cSubject: sub,
  11. cMsg: msgBody,
  12. cSubmitAs: "PDF"
  13. });

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

jsaynavong
Registered: Oct 12 2006
Posts: 12
Thanks Radzmar!
mikeg
Registered: Dec 22 2009
Posts: 8
Radzmar - thanks so much for posting that JavaScript for the Submit Email button. I've gotten it to work perfectly on my own development machine, however, my colleagues have our corporate standard Lotus Notes version, which is 6.5.5, and when the Submit Email button is pressed, the variables in your code snippet don't function as expected, whereas on Notes 8.1, which I have, it works perfectly.

Here is an example where it is not behaving properly.

var address = MyMailAddress; -> The value is repeating in the user's email address, and in between the repeats, somehow it inserts the message body, all within the To: line of the email.Is there another way to send the PDF form as a PDF, using a simple Java Script snippet like that one?

Thanks in advance, for any replies!
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
I have Lotus Notes 6.5.5 too, and don't have any problems with this code.
So I don't see what's can cause this problem, sorry.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

mikeg
Registered: Dec 22 2009
Posts: 8
Radsmar - My company uses a custom-created Notes stationary that may be causing the problem for us.

I put my Adobe form on my website, at this address > edit - removed doc /< . Can you see if it works on your Notes client?I'm going to check with other colleagues to see if anyone has any other ideas how to enable this form to be used with our current version of Notes.

Thanks again for your help!
mikeg
Registered: Dec 22 2009
Posts: 8
My project just got killed so I don't need the form anymore. Thanks for the help provided.

Best regards,
Mike
Acharabelle
Registered: Aug 19 2010
Posts: 2
Radzmar,

Your code got me the closest to doing what I wanted it to do. Do you have a modified version that would still let me create the e-mail, but without attaching the form?

Thanks!

I would rather be condemned by others for doing what I thought was right than face my own condemnation because I did not.