Ask questions and get good answers on mb.jQuery.components

How to use the IF ELSE condition inside the rule function in Jquery Validation.

I am using one form for some fields are require for option 1 and some fields are require for option 2.

Example

for the below code I need name and address for option one and name and url for option 2. How to use the IF/Else condition for this.

$(document).ready(function(){
$("#demo-form").validate({
rules: { name: "required", address: "required", url: "required url", integer: { required:true, integer:true, min: 5 }, } });

asked Jun 23 '11 at 08:49

vivekmyself's gravatar image

vivekmyself
1

Be the first one to answer this question!
toggle preview

jQuery main site - Matteo Bicocchi