jQuery unobtrusive custom adapter and method in jsFiddle
问题 I cannot make this jsFiddle work but it works in the browser: http://jsfiddle.net/vtortola/jYq2X/ I am trying to add a new custom rule to compare two fields. The custom adapter works, it is being called and setting the options. But the custom method is never called. I am executing this JS on DOM ready: $.validator.addMethod("customequal-method", function (val, el, p) { var $other = $(el).closest('form').find('input[name=' + p.other + ']'); return $other.length && $other.val() == val; }); $