These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Send error, stop processing

johnmolina
Registered: Mar 27 2008
Posts: 76

I have a form with many fields for user.

I have a submit button at end that will create xml at end. that works.

When a required field is not filled in, user gets error message. however it keeps on processing and creates the xml.

When the user gets an error, I want to stop the processing at that point and not validate any further and create an xml until all fields are correct

I have not worked a lot with javascript and has been over a year since I have done anything. any help is appreciated.

my code

MAT100.#subform[0].rad_subform.field_off_num::preSubmit:form - (JavaScript, client)

if ((this.rawValue == null) || (this.rawValue == ""))
{ app.alert("Please enter Field Office phone number in 8605943500 format prior to submitting.");
}

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You have to exit the code being run by the 'submit' button. You can do this by creating a variable to hold the value if all of the required fields are completed or not, and if the variable indicate that the fields have not been completed, then do not perform the submit action.
// create a variable that assumes all required form fields are completevar bComplete = 1;// ... codeif ((this.rawValue == null) || (this.rawValue == "")){       app.alert("Please enter Field Office phone number in 8605943500 format prior to submitting.");bComplete = 0; // force to not complete}// ... more codeif(bComplete) {// perform submit action}

George Kaiser