In our project we are using ValidationEngine, and we don't have the ability to replace it with another plug-in.
Our form has ten inputs and some of them are optional, but at least one of the optional fields must be included.
So, how do you validate inputs in this case?
Sample:
form
input1
input2
intpu3
input1: required
At least one of input2 and input3 must be present -- if both are empty validation should fail.
The validation engine now supports group Validation.Go to jQuery form validation plugin @ github and ake a look at groupRequired
. The syntax looks something like this.
<input value="" class="validate[groupRequired[payments]]" type="text" name="creditcard" id="creditcard" />
<input class="validate[groupRequired[payments]]" type="text" id="paypal" name="paypal"/>