/maxlengthJS

Javascript maxlength validator

Primary LanguageJavaScript

maxlengthJS

Javascript maxlength validator

preview

Installation

Include jQuery

Include maxlength.css and maxlength.js

Usage

Give jQuery element selector to new Maxlength instance

<script type="text/javascript">
// for all inputs
new Maxlength('input');

// for text type inputs
new Maxlength('input[type=text]');

// for inputs which have maxlength attribute
new Maxlength('input[maxlength]');

// for specific input
new Maxlength('#inputId');
</script>

Customization

You can write your own css code inside --maxlength class to change look