From e1c8cc18ab3d08461a8e7b4b401dbf8ec7c2c15c Mon Sep 17 00:00:00 2001 From: Spencer Date: Fri, 14 Sep 2012 14:53:43 -0600 Subject: [PATCH] Fix error: validator not defined For some reason the static rules function is being called on a form that the validator was never bound to. This extra check will at least suppress this error until someone can figure out why this function is being called referencing a form that was never associated with the validator. --- jquery.validate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.validate.js b/jquery.validate.js index 0828c394f..5fab832f1 100644 --- a/jquery.validate.js +++ b/jquery.validate.js @@ -891,7 +891,7 @@ $.extend($.validator, { staticRules: function(element) { var rules = {}; var validator = $.data(element.form, 'validator'); - if (validator.settings.rules) { + if (validator && validator.settings.rules) { rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}; } return rules;