monkeylee monkeylee - 5 months ago 16
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' !! ");