I have this validator form code I have inherited which I am getting this error:
$.validator.methods[method] is undefined
and under that it
You are getting this error because you're calling a non-existent rule
...
rules: {
//other rules,
interest2: {
notEqualTo: "#interest"
},
}
notEqualTo
is not a valid rule included within this plugin. You must remove it or create a new rule called notEqualTo
by using the plugin's built-in addMethod() method. Something like this...
jQuery.validator.addMethod('notEqualTo', function(value, element, param) {
return value != jQuery(param).val();
}, 'Must not be equal to {0}.' );