Expand my Community achievements bar.

SOLVED

Button - Submit Email

Avatar

Level 1

I am having a very difficult time creating a Button in LiveCycle Designer that works correctly as I want. I've read at least 10 articles and everyone of them dispute one another in method.

Basically, I want a user to fill out this form and then hit the Email Submit Button and it sends that PDF to User1 and cc's User2, but I understand that the user that fills out the form must have Adobe Acrobat and not just Reader.

So that leads me back to creating a regular button. When I do this I cannot find a JavaScript code that actually works to what I would like it to. All I want is a hardcoded To and CC, hardcoded and variable Subject, and hardcoded Message Body with the PDF attached. (Variable Subject would take fields from the document to create a line.) I would also like to rename the file sent with the same fields as used in the Subject line.

Is this possible?

LiveCycle Designer ES 8.2.1

OS Win 7 64 Bit

1 Accepted Solution

Avatar

Correct answer by
Level 1

radzmar

I wanted to share what I go to work, but we have decided to go another way since our users could not send the form with data through the submit button. I will just have them print to PDF and email to the correct people - clunky I know, but so is the lack of functionality with Adobe Reader.


form1.NewProjectRequestForm.Button1::click - (JavaScript, client)


var oDoc = event.target;



oDoc.mailDoc({


bUI: true,


cTo: "soandso@email.com",


cCc: "soandso@email.com",


cSubject: "New Site Requested:" + " " + SiteCode.rawValue  + " - " + Description.rawValue + " -- " + "Requested by:" + " " + Requestor.rawValue + " @ " + RequestDate.rawValue,


cMsg: "New Site Requested" + " " + SiteCode.rawValue + " - " + Description.rawValue


});


View solution in original post

2 Replies

Avatar

Level 10

Hi,

you can use a regular button and a JavaScript in its click event to send the form.

Here an example:

The variables var0 and var1 holding the values from form fields which are used for the cTo and cCc parameters of the script.


var var0 = xfa.resolveNode("Formular1.#subform.Textfield1").rawValue;


var var1 = xfa.resolveNode("Formular1.#subform.Textfield2").rawValue;



event.target.mailDoc({


  bUI: false,


  cTo: var0,


  cCc: var1,


  cBcc: '',


  cSubject: 'Add your mail subject here ...',


  cMsg: 'Add your mail message here ...'


});


This will also work in Adobe Reader when you add additional rights to your form with Acrobat once.

How you can do this depends on the version of Acrobat you use.

In Acrobat XI it's under File > Save as Other > Reader Extended PDF.

Avatar

Correct answer by
Level 1

radzmar

I wanted to share what I go to work, but we have decided to go another way since our users could not send the form with data through the submit button. I will just have them print to PDF and email to the correct people - clunky I know, but so is the lack of functionality with Adobe Reader.


form1.NewProjectRequestForm.Button1::click - (JavaScript, client)


var oDoc = event.target;



oDoc.mailDoc({


bUI: true,


cTo: "soandso@email.com",


cCc: "soandso@email.com",


cSubject: "New Site Requested:" + " " + SiteCode.rawValue  + " - " + Description.rawValue + " -- " + "Requested by:" + " " + Requestor.rawValue + " @ " + RequestDate.rawValue,


cMsg: "New Site Requested" + " " + SiteCode.rawValue + " - " + Description.rawValue


});