Disable jquery validation for a particular field

279 Views Asked by At

I am using jQuery live validation for twitter bootstrap(https://github.com/ddarren/jQuery-Live-Form-Validation-For-Twitter-Bootstrap) in my rails app.I want to remove the validation from a field for a particular condition. Ex:

if(project=='Fixed'){
 $("#project_price").validate({
     expression: "if(VAL != '') return true; else return false;",
     message: "Price  is required."
  });
}
else{
//Disable validation for price field
}

Can anyone suggest how to remove/disable jQuery live validation?

1

There are 1 best solutions below

0
On

Have you tried just to overwrite the behaviour with something like:

$("#project_price").validate({
     expression: "return true;",
});

?