FormBuilder@adobeforums.com wrote:
> Since it sounds like you only need to perform the validations just before the form gets submitted, you can probably use what I call the "two button submit technique" (I'm going with a term here since it's used so often).
>
> This consists of using two buttons: One regular button and one submit button (either email or HTTP). The submit button is made invisible and the Click event of the regular button (the "fake submit button") is used to perform the validations and, if all succeed, execute the invisible submit button's Click event, triggering the submission of the form.
>
> To illustrate this concept, I've created a sample form with three text fields where at least one text field needs to be filled prior to submitting the form.
>
> Stefan
> Adobe Systems
You can also manipulate the 'mandatory' property in script. For example, you could set all three
fields to required initially, and then you could put the following code on the 'exit' event of field A:
if (this.rawValue != null)
{
this.mandatory = "error";
this.parent.fieldB.mandatory = "disabled";
this.parent.fieldC.mandatory = "disabled";
}
This will make fieldB and fieldC optional once fieldA has been filled in. You would put similar
script on the other two fields.
The benefit of this over the two-button submit technique is that you will still get the automatic
validation and highlighting of required fields that is provided within Acrobat and Reader.
--
Justin Klei
Cardinal Solutions Group
www.cardinalsolutions.com