Skip to main content

CharCountController

Purpose​

Add a visual count of the number of characters in a textarea/string input, with an option for highlighting min/max characters.

Actions​

ActionPurpose
--

Targets​

TargetPurposeDefault
inputThe <input> or <textarea> to count characters on-
outputThe place where the characters count will be output-

Classes​

ActionPurpose
error (Optional)The class to apply if the user does not meet the min/max characters (if specified)

Values​

ValueTypeDescriptionDefault
minNumberThe minimum number of character. This will add an error class (See: Classes) to the input if the min character are not met0
maxNumberThe maximum number of character. This will add an error class (See: Classes) to the input if the max character are exceeded99,999

Events​

EventWhenDispatched onevent.detail
----

Side Effects​

The controller will add an event listener for input to the input target.

How to Use​