codice:
<script>
function checkMaxLen( __hTextArea, __maxLength )
{
if ( __hTextArea.value.length > __maxLength )
{
alert( "Il campo " + __hTextArea.name + " può contenere solo " + __maxLength + " caratteri" );
__hTextArea.value = __hTextArea.value.substring( 0, __maxLength );
__hTextArea.select( );
__hTextArea.focus( );
return false;
}
return true;
}
</script>
<TEXTAREA onchange="checkMaxLen( this, 2 );" onkeyup="checkMaxLen( this, 2 );"></TEXTAREA>
se noti __hTextArea.value = __hTextArea.value.substring( 0, __maxLength );
è stato tolto xke a quell'altro utente serviva diverso!