웹/웹.html.스크립트
자바스크립트 텍스트에어리어 textarea 글자수 제한하기
구들
2008. 2. 29. 16:02
<script>
function textareaMaxlenth()
{
var frm=document.getElementById('message');
if(frm.value.length > 800)
{
alert("글자수는 400자로 제한됩니다.");
frm.value=frm.value.substring(0,800);
frm.focus();
}
}
</script>
function textareaMaxlenth()
{
var frm=document.getElementById('message');
if(frm.value.length > 800)
{
alert("글자수는 400자로 제한됩니다.");
frm.value=frm.value.substring(0,800);
frm.focus();
}
}
</script>
<textarea name=message cols="40" rows="11" class="form03" border=0 onKeyup='textareaMaxlenth()'></textarea>