4 Replies Latest reply on Mar 10, 2011 6:15 PM by vanderpoodle

    validate mandatory fields and cancel submit if blank


      I'm new to this and really stuck. How can I require mandatory fields to have a value prior to allowing the user to submit via email? I have a regular control type button that is scripted to email the form, however I want to disallow that if the User-Required fields are blank.  I can get it to validate the fields by placing this in the mouse down event:



      (form1.execValidate() == false)


      xfa.host.messageBox("One or more mandatory fields is blank. Please return to the form to complete all fields marked with a *. \n\nThank you!"

      , "Form is incomplete", 0, 0);



      but I can't make the email submission process stop after that. I would most appreciate any help. If I can't figure this out, I guess I will workaround by hiding the submit button until required fields are complete, but I hate to do that when I know there has to be a simple way that's much better!