Questo script javascript mostra quanti caratteri restano in una textarea.
onload="showRemaining(document.forms['myForm'].elements['myInput']);">
<script type="text/javascript">
function showRemaining(formElement) {
var theForm = formElement.form;
var remainingDisplay = formElement.name + 'Remaining';
theForm.elements[remainingDisplay].value = formElement.maxLength -
formElement.value.length;
}
</script>
<form name="myForm">
<input type="text" name="myInput" maxlength="20"
onkeyup="showRemaining(this);">
<input type="text" name="myInputRemaining" size="2" readonly>
</form>




