Return to Snippet

Revision: 36417
at November 22, 2010 01:15 by kreamweb

Initial Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="">
    <title>Limit Number of Characters in a TextArea</title>
        <script type='text/javascript'
    <script type='text/javascript'>
        $(document).ready(function() {
            $('#note').keyup(function() {
	            var max=140;
                var len = this.value.length;
                if (len >= max) {
                    this.value = this.value.substring(0, max);
                $('#charLeft').text(max - len);
<textarea id="note" cols="20" rows="8"></textarea><br/>
(Maximum characters: 140)<br/>
<span id="charLeft"> </span>  Characters left

Initial URL

Initial Description

Initial Title
Textarea limitazione caratteri

Initial Tags

Initial Language