<script> var maxLen1=500; function checker() { str1 = document.fmsg.text0.value; len1 = str1.length; if ( len1 > maxLen1 ) document.fmsg.text0.value = str1.substring(0,maxLen1); document.fmsg.lenval.value = (maxLen1 - document.fmsg.text0.value.length); document.fmsg.text0.focus(); } </script> <input name=lenval value=500 size=2><input type=text maxlength=500 name=text0 class=text size=80 onKeyUp=checker() >
<script> var maxLen1=500; function checker() { str1 = document.fmsg.text0.value; len1 = str1.length; if ( len1 > maxLen1 ) document.fmsg.text0.value = str1.substring(0,maxLen1); document.fmsg.lenval.value = (maxLen1 - document.fmsg.text0.value.length); document.fmsg.text0.focus(); } </script>