monkeylee monkeylee - 3 months ago 11
jQuery Question

jquery validation rule for contains

is there way to create a rule in the jquery validiation plugin that allows you to say not contains "value"?

Answer

you can add method

jQuery.validator.addMethod("notcontainfoo", function(value, element) { 
  return value != 'foo'; 
}, "You can't fill this with 'foo' !! ");
Comments