#18577368 필수 필드가 아닌 경우에는 값을 체크하지 않도록 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7084 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2009-12-30 09:43:12 +00:00
parent 9ffc20d6cf
commit bd1fa7ed8f

View file

@ -92,12 +92,13 @@ var Validator = xe.createApp('Validator', {
if (!_el) return true;
var el = $(_el), val = get_value(el);
var el = $(_el), val = $.trim(get_value(el));
var minlen = parseInt(this.minlen) || 0;
var maxlen = parseInt(this.maxlen) || 0;
var rule = (this.rule || '').split(',');
if (this.required && !val) (result = (!!self.cast('ALERT', [form, name, 'isnull']) && false));
if (this.required && !val) return (result = (!!self.cast('ALERT', [form, name, 'isnull']) && false));
if (!this.required && !val) return (result = true);
if ((minlen && maxlen) && (val.length < minlen || val.length > maxlen)) return (result = (!!self.cast('ALERT', [form, name, 'outofrange', minlen, maxlen]) && false));
if (this.equalto) {