Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Textfield Counter

3,839 sites Security covered
View on drupal.org

This module adds character counters to text fields and text areas, showing users how many characters they have left. The counter updates in real-time as they type and can be configured to appear above or below the field, with options for JavaScript validation and custom messages.

Module summary

This module adds new widgets for the form display of each of the field types that ship with core, for 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 with JavaScript as the user types. The counter works on text fields, text areas, and CKEditor editors.

Widget settings allow users to choose the location of the counter (above or below), whether to use JavaScript validation to prevent form submission when the character count is exceeded, whether to count HTML characters, and a customizable message indicating how many characters are remaining.

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'.

Activity

Total releases
2
First release
Jun 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Release date
2.5.0 Stable Jun 24, 2025
2.5.0-rc1 Pre-release Jun 2, 2025