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

Validate before submitting

Runolfr
Registered: Oct 1 2008
Posts: 119
Answered

I have some code that runs in the preSubmit event of a button that submits my form by email. Among other things, the code locks all of the form fields. Is there a form property I can check to make sure the form is valid before that code runs?

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Are you using LiveCycle Designer? You need to clarify what you mean by "valid".

George
Runolfr
Registered: Oct 1 2008
Posts: 119
I am using LiveCycle Designer.

Basically, I am changing the "mandatory" property of some fields based on the content of others. It's a medical form, and it has a field for medication. If something goes into that field, then additional fields for dosage and such become mandatory.

I want the preSubmit script to make sure that all "mandatory" fields have been completed before it locks the form fields.

The way it's running currently, the script locks the fields before it checks to see if mandatory fields are complete. When the submission fails to complete because there are incomplete mandatory fields, the fields are all locked, making it impossible to fill out the incomplete fields and resubmit the form.
Runolfr
Registered: Oct 1 2008
Posts: 119
Figured it out.

Enclosed the whole preSubmit script in...

if (FormName.execValidate() == true)