Answered
I am using the sample script in the LiveCycle book and I want to create a button that sends an e,mail using a "text" field for the e.mail address;
What am I missing ????? The Text field and the Button are in the same place;
xfa.form.form1.InputSubform1.PrintSubForm.TextField4 (test field for address)
xfa.form.form1.InputSubform1.PrintSubForm.Button4 (regular button)
var mail;
var address = xfa.form.form1.InputSubform1.PrintSubForm.TextField4 ;
var sub = "Test email from rod";
mail = "mailto: " + address + "?subject=" + sub;
event.target.submitForm({
cURL: mail,
bEmpty: true,
cSubmitAs: "PDF",
cCharset: :utf-8"
});
Thanks for help in advance !!!!! Rod
var myDoc = event.target;
var address = TextField4.rawValue;
var sub = "Test email from Rod";
var msgBody = "This is text in the body of the message if you want";
myDoc.mailDoc({
bUI: false,
cTo: address,
cSubject: sub,
cMsg: msgBody,
cSubmitAs: "PDF"
});
}
If you want to send to more than one email address, concatenate your addresses together in a single field and separate each address with a semi-colon.
Make sure that your language is JavaScript for the code. Run At: must be set to 'Client'.
This is a more flexible way of sending off the email as you have a bit more control over what goes on.
Good luck!