Copy link to clipboard
Copied
Hello,
I am using the below Java (altered with my field names and e-mail address) from this page: https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address/
// This is the form return email. It's hardcoded // so that the form is always returned to the same address. // Change address on your form to match the code below var cToAddr = "formsAdmin@BigCorp.com" // First, get the client CC email address var cCCAddr = this.getField("ClientEmail").value; // Now get the beneficiary email only if it is filled out var cBenAddr = this.getField("BennyEmail").value; if(cBenAddr != "") cCCAddr += ";" + cBenAddr; // Set the subject and body text for the email message
var cSubLine = "Form X-1 returned from " + this.getField("ClientFirstName").value + " " + this.getField("ClientLastName").value;
var cBody = "Thank you for submitting your form.\n" + "Save the filled form attachment for your own records" // Send the entire PDF as a file attachment on an email this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody});
Prior to me adding this code the standard submit button would not submit throwing up an error about required fields not completed. With the new button the form submits even with nothing filled in. What code can I use and where would I put (if I need to put something on each required field) it so that the above button will not submit if required fields are not completed?
Copy link to clipboard
Copied
Info: Acrobat uses Javascript, not Java.