PHPackages                             jonom/silverstripe-text-target-length - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. jonom/silverstripe-text-target-length

ActiveSilverstripe-vendormodule[Validation &amp; Sanitization](/categories/validation)

jonom/silverstripe-text-target-length
=====================================

Set character length recommendations on SilverStripe text form fields

2.0.4(10mo ago)32132.4k↑19%16[1 PRs](https://github.com/jonom/silverstripe-text-target-length/pulls)9BSD-3-ClauseJavaScript

Since Mar 10Pushed 10mo ago4 watchersCompare

[ Source](https://github.com/jonom/silverstripe-text-target-length)[ Packagist](https://packagist.org/packages/jonom/silverstripe-text-target-length)[ Fund](https://www.paypal.me/jmnz)[ GitHub Sponsors](https://github.com/jonom)[ RSS](/packages/jonom-silverstripe-text-target-length/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (10)Used By (9)

Text Target Length for Silverstripe CMS
=======================================

[](#text-target-length-for-silverstripe-cms)

[![Character limits in action](screenshots/character-count.gif)](screenshots/character-count.gif)

If you see a field marked 'Description' you know roughly what type of content to put in there. But how do you know how much of it to write? A single sentence might do, but maybe a paragraph or more is required? A great content plan should recommend an ideal length for every type of content, so content authors and designers alike can make informed decisions.

This module extends the `TextField`, `TextareaField` and `HTMLEditorField` classes in Silverstripe to allow you to set a recommended content length, and set soft upper and lower limits on character count.

Requirements
------------

[](#requirements)

Silverstripe 4|5|6 (3.1+ in previous releases)

Installation
------------

[](#installation)

`composer require jonom/silverstripe-text-target-length`

[Packagist listing](https://packagist.org/packages/jonom/silverstripe-text-target-length)

How to use
----------

[](#how-to-use)

With the module installed you can call call `setTargetLength()` on `TextField`, `TextareaField` and `HTMLEditorField` form fields.

```
// Ideal length: 100 characters
// Minimum: 75 (automatically set at 75% of ideal)
// Maximum: 125 (automatically set at 125% of ideal)
$field->setTargetLength(100);

// Ideal length: 100 characters
// Minimum: 25
// Maximum: 150
$field->setTargetLength(100, 25, 150);

// Prefer to think in word count?
// 6 characters per word works okay for English
$field->setTargetLength(50*6);
```

### Customise hint text

[](#customise-hint-text)

This module supports translation through yml, so if you want to change the hint text that is displayed when users are typing, just create your own language file to override the one included in the module.

### Front-end use

[](#front-end-use)

If you want to use this module outside of the CMS, you will need to load a copy of jQuery and jQuery Entwine in to the page. Example:

```
Requirements::javascript('silverstripe/admin:thirdparty/jquery/jquery.js');
Requirements::javascript('silverstripe/admin:thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
```

Maintainer contact
------------------

[](#maintainer-contact)

[Jono Menz](https://jonomenz.com)

Sponsorship
-----------

[](#sponsorship)

If you want to boost morale of the maintainer you're welcome to make a small monthly donation through [**GitHub**](https://github.com/sponsors/jonom), or a one time donation through [**PayPal**](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z5HEZREZSKA6A). ❤️ Thank you!

Please also feel free to [get in touch](https://jonomenz.com) if you want to hire the maintainer to develop a new feature, or discuss another opportunity.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance54

Moderate activity, may be stable

Popularity44

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~425 days

Recently: every ~678 days

Total

9

Last Release

315d ago

Major Versions

0.2 → 1.0.02017-01-09

1.0.1 → 2.0.02018-01-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/54ba1a57c516be631e90bac916e1add4a84fe2b39284aa5a5cc5ea37c0d6cefa?d=identicon)[Jono M](/maintainers/Jono%20M)

---

Top Contributors

[![jonom](https://avatars.githubusercontent.com/u/1079425?v=4)](https://github.com/jonom "jonom (12 commits)")[![chtombleson](https://avatars.githubusercontent.com/u/276237?v=4)](https://github.com/chtombleson "chtombleson (3 commits)")[![a2nt](https://avatars.githubusercontent.com/u/672794?v=4)](https://github.com/a2nt "a2nt (2 commits)")[![satrun77](https://avatars.githubusercontent.com/u/166450?v=4)](https://github.com/satrun77 "satrun77 (2 commits)")[![zanderwar](https://avatars.githubusercontent.com/u/13566916?v=4)](https://github.com/zanderwar "zanderwar (2 commits)")[![obj63mc](https://avatars.githubusercontent.com/u/443120?v=4)](https://github.com/obj63mc "obj63mc (1 commits)")[![xini](https://avatars.githubusercontent.com/u/1152403?v=4)](https://github.com/xini "xini (1 commits)")[![TheBnl](https://avatars.githubusercontent.com/u/1334195?v=4)](https://github.com/TheBnl "TheBnl (1 commits)")[![hdpero](https://avatars.githubusercontent.com/u/13778690?v=4)](https://github.com/hdpero "hdpero (1 commits)")[![lerni](https://avatars.githubusercontent.com/u/472115?v=4)](https://github.com/lerni "lerni (1 commits)")

---

Tags

silverstripetargettextfieldtextareafield

### Embed Badge

![Health badge](/badges/jonom-silverstripe-text-target-length/health.svg)

```
[![Health](https://phpackages.com/badges/jonom-silverstripe-text-target-length/health.svg)](https://phpackages.com/packages/jonom-silverstripe-text-target-length)
```

###  Alternatives

[undefinedoffset/silverstripe-nocaptcha

A spam protector and form field using Google's reCAPTCHA v2 or optionally a foundation v3 implementation

33471.6k16](/packages/undefinedoffset-silverstripe-nocaptcha)[sheadawson/silverstripe-zenvalidator

Faster, easier client and server-side form validation for SilverStripe

5778.4k2](/packages/sheadawson-silverstripe-zenvalidator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
