X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..530ef4b6c5b943cfa68b779d11cf7de29aa878bf:/src/widgets/form/TextField.js diff --git a/src/widgets/form/TextField.js b/src/widgets/form/TextField.js index 27627b36..2f84e160 100644 --- a/src/widgets/form/TextField.js +++ b/src/widgets/form/TextField.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -440,13 +440,22 @@ var myField = new Ext.form.NumberField({ value = value || this.processValue(this.getRawValue()); - if(Ext.isFunction(this.validator)){ + if (Ext.isFunction(this.validator)) { var msg = this.validator(value); if (msg !== true) { errors.push(msg); } } + if (value.length < 1 || value === this.emptyText) { + if (this.allowBlank) { + //if value is blank and allowBlank is true, there cannot be any additional errors + return errors; + } else { + errors.push(this.blankText); + } + } + if (!this.allowBlank && (value.length < 1 || value === this.emptyText)) { // if it's blank errors.push(this.blankText); }