<html>
<head>
<script language="javascript">
function checklen(){
var form1=document.myform;
if (form1.content.value.length>4000){
alert("非常抱歉,输入内容太多,请重新输入!");
form1.content.select();
return false;
}
form1.submit();
}
</script>
</head>
<body>
<form name="myform" action="" method="post">
<textarea name="content" cols=60 rows=7></textarea>
<input type="button" name="submitbtn" value="ok" onclick="checklen()">
</form>
</body>
</html>
//注意,Form的name必须与函数checklen中的document.myform一致
<head>
<script language="javascript">
function checklen(){
var form1=document.myform;
if (form1.content.value.length>4000){
alert("非常抱歉,输入内容太多,请重新输入!");
form1.content.select();
return false;
}
form1.submit();
}
</script>
</head>
<body>
<form name="myform" action="" method="post">
<textarea name="content" cols=60 rows=7></textarea>
<input type="button" name="submitbtn" value="ok" onclick="checklen()">
</form>
</body>
</html>
//注意,Form的name必须与函数checklen中的document.myform一致
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货