Max Char


Provide a help text that displays how many characters remain available in a text area.


Include the following java scripts on your page.  The option max: 300 states that we allow up to 300 characters in this textarea.

<script type="text/javascript"
    src="//" ></script>
<script type="text/javascript">
(function($) {
    $(document).ready(function() {
         $(".maxchar").maxchar( {
             max : 300
         } );

In this case, we specified that all textarea elements with class maxchar will have this feature. By default, the widget will look for the first element with class help after the textarea and put the messages here.

<textarea class="maxchar"></textarea>
<span class="help"></span>

If you want to put the help text in another element other than help class. Pass in another option such as the following: infoClass: maxchar_help to let the widget to put the message in an element with class maxchar_help

JavaScript Widgets