Demo

Experimental project

This is a sandbox project, which contains experimental code for developer use only.

A JQuery based counter on textareas. This can be used to limit or warn users that they are over the maximum limit of the element. This falls back to Drupal native validation (in the case of #maxlength) or a custom server side validation that takes double character newlines into account (in the case of #js_maxlength). Any scripts should be aware that "\n\r" are counted as a single character.

The element can be enabled globally on all textareas that have the FAPI property "#maxlength" or targetted specifically on specific textareas using the custom FAPI property "#js_maxlength".

The module works by attaching an element to the textarea, just like the re-sizable grippie, that provides the user with a display of the characters remaining.

The container has 3 possible classes, under-limit, on-limit and over-limit for easy theming.

Currently using the fork of Jeremy Horn's (The Product Guy) JQuery Script NobleCount by kumichou. The future would be to create a generic wrapper and allow users to decide what script that they would want to handle character counters (and create a module with a more generic name).

No external libraries to install as the module uses a non-committed fork of Jeremy's project and is licensed under GPL.

Project information