Home

# Class goog.ui.CharCounter

CharCounter widget. Counts the number of characters in a input field or a text box and displays the number of additional characters that may be entered before the maximum length is reached.

extends goog.events.EventTarget

Instance Method Summary
| `checkLength_()` Checks length of text in input field and updates the counter. Truncates text if the maximum lengths is exceeded.

`disposeInternal()`

Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:

    MyClass.prototype.disposeInternal = function() {
    MyClass.superClass_.disposeInternal.call(this);
    // Dispose logic for MyClass
    };

| `getDisplayMode() ⇒ !goog.ui.CharCounter.Display` Returns the display mode.
| `getMaxLength() ⇒ number` Returns the maximum length.
| `onChange_(?goog.events.BrowserEvent event)` Change event handler for input field.
| `setDisplayMode(!goog.ui.CharCounter.Display displayMode)` Sets the display mode.
| `setMaxLength(number maxLength)` Sets the maximum length.