troubleshooting Question

Livecycle Event PreSubmit

Avatar of contesa
contesaFlag for United States of America asked on
JavaScriptAdobe Acrobat
17 Comments2 Solutions2227 ViewsLast Modified:
I have a form with a Submit button and one mandatory field that has code to validate format of date and to keep focus on field until correct format is entered.

If the user clicks on the Submit button without clicking in the Date Field first, the form is sent.  I want to insert a presubmit event that will check the mandatory field prior to sending the form.

I used the following code but after it alerts the user that data is missing, i get an error that says Submit Cancelled and the form is not sent.  I am using an Email Submit button - nothing in the url field and PDF selected.

I would also like to add a subject line and body to message prior to sending.

//Check if all the mandatory fields are filled in or not
if(isMandatoryFieldMissed.value == "0"){
this.resolveNode("#event").submit.target = "mailto:dice@njdge.org";

}
else{
xfa.host.messageBox("One or more of the required fields were missing data before submitting.");        
}


ASKER CERTIFIED SOLUTION
leakim971
Multitechnician
Join our community to see this answer!
Unlock 2 Answers and 17 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros