Text Field Counter

Component ID

2869943

Component name

Text Field Counter

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

182

Component created

Component changed

Component body

Module summary

This module adds new widgets for the form display of each of the field types that ship with core, both text fields and text areas. The widgets this module provides extend the default core widgets, adding a text counter that displays the remaining number of characters allowed in the field. This counter updates as the user types. There is also a setting for the counter to be above or below the text field. If any field has more characters entered than the field allows, form submission is prevented until the number of characters is adjusted to the correct amount.

Applicable Field types

The field types that this module works on are:

  • Text (formatted)
  • Text (formatted, long)
  • Text (formatted, long, with summary)
  • Text (plain)
  • Text (plain, long)

Use Instructions

To use this module, install it as you would any module. Create a new field of the types listed above, then go to the 'Manage form display' tab. In the 'widget' column, select the widget that ends with 'and a counter'.

Development roadmap

The module should work fine right now, and is usable on production sites. However, it still needs automated testing before a full release. If anyone wants to contribute automated tests for the module, please open a ticket in the issue queue.