public void Validate()
    {
        _isValid = true;
        if (!_visible || !_enabled){
            return;
        }

        if (_isRequired){
            if (_text.isEmpty() || _text.length() == 0){
                _errorMessage = "Required field can not be empty.";
                _isValid = false;
            }
        }

        if (_maxLength != 0 && _text.length() > _maxLength)
        {
            _errorMessage = "Text length can not exceed" + _maxLength;
            _isValid = false;
        }

        if (_minLength != 0 && _text.length() < _minLength)
        {
            _errorMessage = "Text length can not under" + _minLength;
            _isValid = false;
        }
    }