Hi Chris,
Yes this can be easily done. I gathered the following solutions from various threads and so I am not claiming any originality here...
Set up a textfield "Email", with a tooltip telling users to separate email addresses with a ";".
Next set up a regular button with the following Javascript in the click event:
var email = xfa.resolveNode("form1.#subform.Email").rawValue;
var subject = "Specify your subject line here"
event.target.submitForm({cURL:"mailto: "+ email +"?subject=" + subject +"&body=You can also input some standard text to appear in the body of the email.",cSubmitAs:"PDF",cCharset:"utf-8"});
You might want to put an if statement that if the "Email" textfield is blank/null that an app.alert comes up informing the user to input at least one email address.
We took it a stage further on one of our forms. We set up three checkboxes with people's names who are regularly sent the form (nod and cc1 and cc2) and then a textfield "additional" for additional addresses.
Each checkbox had an associated Textfield (EM1_email, cc1_email, and cc2_email) that were invisible. Each checkbox had similar Javascript in the mouse up event:
if (this.rawValue == 0) {
EM1_email.rawValue = null;
}
else {
EM1_email.rawValue = "someone@company.ie;";
}
Then we set up another invisible textfield (Email) which had the following Formcalc in the calculate event:
if (nod.rawValue == 0 & cc1.rawValue == 0 & cc2.rawValue == 0) then
$ = null
else
$ = Concat(EM1_email, cc1_email, cc2_email, additional)
endif
This basically pulled the email addresses from the ticked checkboxes and the additional user inputted email addresses into one text field. From there the regular button with the script above send the email. This speeded up the process for regular reciptents.
If you search the forum for topics such as cURL:"mailto: you should see lots of other examples.
Good luck,
Niall