<script language="javascript" type="text/javascript">
function textlen(x,y){
var thelength = x.value.length;
window.status=thelength+' of '+y+' maximum characters.';
}
function maxtext(x,y){
tempstr = x.value
if(tempstr.length>y){
x.value = tempstr.substring(0,y);
}
textlen(x,y);
}
</script>
<form name="myform">
<textarea name="mytextarea"
cols="45"
rows="3"
wrap="virtual"
οnkeypress="return(this.value.length<20)"
οnkeydοwn="textlen(this,20)"
οnkeyup="textlen(this,20)"
οnblur="maxtext(this,20)"
></textarea>
</form>