src/aria/widgets/form/TextInput.js
function (enable) {
            var cfg = this._cfg;
            // check for disposal
            if (!cfg) {
                return;
            }
            var helpText = cfg.helptext, helpTextConfig = this._skinObj.helpText;
            // stops if no helptext, or trying to disable an helptext that as
            // not been set
            if (!helpText || !this._helpTextSet && !enable || (this._hasFocus || this._keepFocus) && enable) {
                return;
            }

            var field = this.getTextInputField();

            // stops if trying to set a helptext in a field with a value
            if (field.value && enable) {
                return;
            }

            this._helpTextSet = enable;

            if (!field) {
                return;
            }

            // determine new styles and value
            var color = enable ? helpTextConfig.color : this._getTextFieldColor();
            var value = enable ? helpText : "";

            var helpTextClass = "x" + this._skinnableClass + "_" + cfg.sclass + "_helpText";
            var classNames = field.className.split(/\s+/);
            ariaUtilsArray.remove(classNames, helpTextClass);
            if (enable) {
                classNames.push(helpTextClass);
            }
            field.className = classNames.join(' ');

            // update styles
            var style = field.style;
            style.color = color;

            // update field value
            field.value = value;
        }
function (enable) {
            var cfg = this._cfg;
            // check for disposal
            if (!cfg) {
                return;
            }
            var helpText = cfg.helptext, helpTextConfig = this._skinObj.helpText;
            // stops if no helptext, or trying to disable an helptext that as
            // not been set
            if (!helpText || !this._helpTextSet && !enable || (this._hasFocus || this._keepFocus) && enable) {
                return;
            }

            var field = this.getTextInputField();

            // stops if trying to set a helptext in a field with a value
            if (field.value && enable) {
                return;
            }

            this._helpTextSet = enable;

            if (!field) {
                return;
            }

            // determine new styles and value
            var color = enable ? helpTextConfig.color : this._getTextFieldColor();
            var value = enable ? helpText : "";

            var helpTextClass = "x" + this._skinnableClass + "_" + cfg.sclass + "_helpText";
            var classNames = field.className.split(/\s+/);
            ariaUtilsArray.remove(classNames, helpTextClass);
            if (enable) {
                classNames.push(helpTextClass);
            }
            field.className = classNames.join(' ');

            // update styles
            var style = field.style;
            style.color = color;

            // update field value
            field.value = value;
        }
function ( enable ) { var cfg = this . _cfg ; // check for disposal if ( ! cfg ) { return ; } var helpText = cfg . helptext , helpTextConfig = this . _skinObj . helpText ; // stops if no helptext, or trying to disable an helptext that as // not been set if ( ! helpText || ! this . _helpTextSet && ! enable || ( this . _hasFocus || this . _keepFocus ) && enable ) { return ; } var field = this . getTextInputField ( ) ; // stops if trying to set a helptext in a field with a value if ( field . value && enable ) { return ; } this . _helpTextSet = enable ; if ( ! field ) { return ; } // determine new styles and value var color = enable ? helpTextConfig . color : this . _getTextFieldColor ( ) ; var value = enable ? helpText : "" ; var helpTextClass = "x" + this . _skinnableClass + "_" + cfg . sclass + "_helpText" ; var classNames = field . className . split ( / \s+ / ) ; ariaUtilsArray . remove ( classNames , helpTextClass ) ; if ( enable ) { classNames . push ( helpTextClass ) ; } field . className = classNames . join ( ' ' ) ; // update styles var style = field . style ; style . color = color ; // update field value field . value = value ; }
Set the helptext of the field if needed
@param {Boolean} enable Whether to enable it or not
Set the helptext of the field if needed