Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.26 KB

README.md

File metadata and controls

51 lines (37 loc) · 1.26 KB

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.