Roo/bootstrap/Form.js
authorAlan Knowles <alan@roojs.com>
Thu, 1 Feb 2018 08:32:10 +0000 (16:32 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 1 Feb 2018 08:32:10 +0000 (16:32 +0800)
Roo/bootstrap/Input.js

Roo/bootstrap/Form.js
Roo/bootstrap/Input.js

index 419051c..59ea86f 100644 (file)
@@ -673,8 +673,9 @@ Roo.apply(Roo.bootstrap.Form, {
             var tip = this.target.blankText;
 
             if(this.target.getValue() !== '' ) {
-                if (this.target.errorText.length) {
-                    tip = this.target.errorText;
+                
+                if (this.target.invalidText.length) {
+                    tip = this.target.invalidText;
                 } else if (this.target.regexText.length){
                     tip = this.target.regexText;
                 }
index 9821c6b..6798723 100644 (file)
@@ -207,9 +207,10 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
      */
     regex : null,
     /**
-     * @cfg {String} regexText The error text to display if {@link #regex} is used and the test fails during validation (defaults to "")
+     * @cfg {String} regexText -- Depricated - use Invalid Text
      */
     regexText : "",
+    
     /**
      * @cfg {String} invalidText The error text to display if {@link #validator} test fails during validation (defaults to "")
      */
@@ -669,6 +670,9 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             if(msg !== true){
                 return false;
             }
+            if (typeof(msg) == 'string') {
+                this.invalidText = msg;
+            }
         }
         
         if(this.regex && !this.regex.test(value)){