JavaScript を使用して HTML テキストエリアに最大長を強制する
<textarea onkeypress="return imposeMaxLength(event, this, 110);" rows="4" cols="50"></textarea> <script> function imposeMaxLength(event, object, maxLength) { return (object.value.length <= maxLength) || (event.keyCode == 8 || event.keyCode == 46 || (event.keyCode >= 35 && event.keyCode <= 40)); } </script>