Skip to content

kaiwa/bootstrap-maxlength

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Twitter Bootstrap maxlength character count plugin

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •