After writing character count functionality for several different projects I finally decided to turn it into a convenient reusable plugin.
A couple of things I’ve used this for:
- Integrating with an bespoke SEO toolkit to prevent users making page titles and meta descriptions too long
- Limiting customer responses in feedback forms
- Adding to form sign up validation scripts
- Validation of field length before submission to a varchar limited field in a database
- Plugin can be bound to any textbox or textarea
- Plugin allows for multiple instances on the same page
- Customise the character limit for each instance independently
- Choose from either count up or count down
- Choose from either a hard limit or soft limit (soft limits allow the user to keep typing, but indicate that the limit has been exceeded)
- Apply custom styles when approaching character limit
- Customise ‘Characters Remaining’ text
- Only 2kb compressed
Want to see it in action?
Download the source