I needed a dynamic submit button that would cc a field from the form. I found the following script and it works great, but it doesn't give an error message if someone didn't fill in a required field like a regular submit button would. Is it possible to use the script below but to check for required fields?
// This is the form return e-mail. Its hardcoded
// so that the form is always returned to the same address
// Change address on your form
var cToAddr = "909@gideons.org";
// First, get the client CC e-mail address
var cCCAddr = RegionalDirector;
// Set the subject and body text for the e-mail message
var cSubLine = "909 Camp Visitation Report-" + xfa.resolveNode("#subform[0].#subform[7].Country"); var cBody = "Thank you for submitting your 909 report.\n" + "Save a copy for your records";
// Send the form data as an FDF attachment on an e-mail
event.target.mailDoc({
bUI: true,
cTo: cToAddr,
cCc: cCCAddr,
cSubject: cSubLine,
cMsg: cBody
});