2

I am using ValidationEngine for client side validation. I have a scenario

In my form I have 3 text box, now I want to validate "required" on all the field only if any one of them is filled, else I can proceed with blank form

How do I do this using Jquery validationEngine

2 Answers 2

4

You must use condRequired to set a conditional validation. This is also useful if you want to use chekboxes. Below I put the example of the use:

<input value="" type="text" name="field1" id="fieldToCheck" />
<input class="validate[condRequired[fieldToCheck]]" type="text" id="field2" name="fieldRequiredIfFiel1"/>
Sign up to request clarification or add additional context in comments.

Comments

0

From the documentation for ValidationEngine it doesn't look like it supports optional validation. I would suggest using lightweight validation plugin or jQuery validation.

3 Comments

it does ! it provides a condRequired method for conditional validation.
@Amyth Not sure if this was a feature or not in February when I answered the question. If it was it wasn't documented well. Anyway here is a link to it for future reference.
yeah i am sorry, i realized that they have introduced it in version 2.6 and it wasn't a feature until then. My bad.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.