你的这些写在了哪里?
试试 
if (document.add.a59.value.length<100){alert("不能少于100字!");add.a59.focus();return false;}

解决方案 »

  1.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>New Page 2</title>
    </head><body>
    <textarea ></textarea><input type=button value=check onclick="checkMaxLength(this.previousSibling,20)"
    </body></html>
    <script>
    /**
    *checkMaxLength.
    *JK 2006-11-26
    */
    function checkMaxLength(textareaObj,maxLength)
    {
    if(maxLength == null) maxLength=textareaObj.getAttribute("maxLength");
    if(maxLength == null) maxLength=1024;
    var currentLength = textareaObj.value.length;
    if (currentLength > maxLength) {
    alert("The length of your input ("+currentLength+") is larger than the maxLength ("+maxLength+") .");
    if(textareaObj.createTextRange){
    var textRange=textareaObj.createTextRange();
    textRange.moveStart('character',10);
    textRange.select();
    }
    else textareaObj.select();
    textareaObj.focus();
    return false;
    }
    return true;
    }
    </script>
      

  2.   

    textRange.moveStart('character',10);
    -->>>
    textRange.moveStart('character',maxLength);
      

  3.   

    java,.net,asp,hacker技术讨论群14401742,诚招高手加入,共同讨论,共同发展。