monkeylee monkeylee - 1 year ago 126
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 Source

you can add method

jQuery.validator.addMethod("notcontainfoo", function(value, element) { 
  return value != 'foo'; 
}, "You can't fill this with 'foo' !! ");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download