JS控制输入字符长度
<script language="javascript" type="text/javascript">
function checkLength(ctl)
{
var maxLength=200;
var nowLength=ctl.value.length;
if (nowLength>maxLength)
{
ctl.value=ctl.value.substring(0,maxLength);
}
}
</script>
调用时:onkeyup="checkLength(this);"