<html>

<head>

<script type="text/javascript">

/***********************************************
* Textarea Maxlength script- (c) Dynamic Drive (www.dynamicdrive.com)
* Please keep this notice intact.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

</script>

</head>

<body>

<form>
<textarea maxlength="4" rows="5" cols="35" onkeyup="ismaxlength(this)"></textarea>
</form>

</body>
</html>