- Overview
- Documents
CW CharCount is a jQuery plugin that shows a visual counter next to the input field showing the number of characters remaining for the given field.
Source: clivewalkden.co.uk
Aug 14, 2014 in Forms 3137 views
CW CharCount is a jQuery plugin that shows a visual counter next to the input field showing the number of characters remaining for the given field.
Source: clivewalkden.co.uk
1. INCLUDE JS FILES
<script src="jquery.js"></script> <script src="dist/cw-charcount.min.js"></script>
2. HTML
<form action="#" method="post" id="example1"> <label for="example1name">Name:</label> <input type="text" name="name" id="example1name" maxlength="255"> </form>
3. JAVASCRIPT
$(function(){ $('#example1 input[maxlength]').CWCharCount(); });
4. OPTIONS
Property | Type | Default | Description |
---|---|---|---|
default_class | string | 'cw_count' | This class is applied to the count field on startup and allows you to set the styles needed for it to blend in with your current site styling. |
warning_level | int | 15 | The number of characters remaining before the warning class is added to the count object. |
warning_class | string | 'cw_count_warning' | This class is added to the count field once the warning level has been reached. It is removed if the character count increases above the warning level. |
Tagged with:
cw charcount
jquery plugin
remaining character
character count
input field
remaining character count
visual counter
number of characters
remaining
Related Articles