From bf38c0ff84e68b50698b504cc219c50efa98a726 Mon Sep 17 00:00:00 2001 From: Gabriel Villoldo Date: Thu, 19 May 2016 11:38:13 -0300 Subject: [PATCH] custom validator now validates with blank value. --- js/validator.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/validator.js b/js/validator.js index 17f40ff..de9ba55 100644 --- a/js/validator.js +++ b/js/validator.js @@ -169,7 +169,8 @@ } $.each(Validator.VALIDATORS, $.proxy(function (key, validator) { - if ((getValue($el) || $el.attr('required')) && + var value = getValue($el); + if ((value == '' || value || $el.attr('required')) && ($el.data(key) || key == 'native') && !validator.call(this, $el)) { var error = getErrorMessage(key)