From fbccea5bd2a9d62f7e8ead8d4de488815c05b186 Mon Sep 17 00:00:00 2001 From: "Yurchenko, Ivan" Date: Sat, 25 Apr 2015 18:00:03 +0300 Subject: [PATCH] Apply validator even if matching data attribute is empty or 0 --- js/validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/validator.js b/js/validator.js index f59a6b7..fd57bbf 100644 --- a/js/validator.js +++ b/js/validator.js @@ -140,7 +140,7 @@ } $.each(Validator.VALIDATORS, $.proxy(function (key, validator) { - if (($el.data(key) || key == 'native') && !validator.call(this, $el)) { + if ((typeof $el.data(key) !== 'undefined' || key == 'native') && !validator.call(this, $el)) { var error = getErrorMessage(key) !~errors.indexOf(error) && errors.push(error) }