🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Maxlength is a dead simple jQuery plugin that uses Bootstrap styles and HTML5 maxlength attribute to limit the amount of characters permitted in an input field.

Bootstrap Character-Limit Character-Counter

Documentation

Twitter Bootstrap 3 jQuery maxlength plugin

Appends a character countdown to input fields, showing the characters left until maxlength is reached.

Screenshot

Try the jsfiddle demo to see it live!

Usage Example

<div>     <input type="text" maxlength="120" /> </div>  <!-- Adjust the path to your bootstrap-maxlength.js copy --> <script src="/js/bootstrap-maxlength/bootstrap-maxlength.js"></script>  <!-- Apply maxlength() on all input fields which have a maxlength attribute --> <script> $(document).ready(function() {     $("input[maxlength]").maxlength(); }); </script>

Installation

Download

Simply download a zipped release, unpack it, then add the bootstrap-maxlength.js file to your project.

Bower

Add the package bootstrap-maxlength-simple to your bower.json project file.

{     "name": "My Project",     "dependencies": {         "bootstrap-maxlength-simple": "3.*"     } }

Earlier versions

See 2.0 branch for a version which is compatible with Twitter Bootstrap 2.


You May Also Like