if(check()){document.form1.submit();}check()中正确的话加上return true;

解决方案 »

  1.   

    function checkLen(str,len)
    {
    byte = str.value.replace(/[^\x00-\xff]/g,"**").length;
    if(byte > len)
    {
    alert("aa");
    str.focus();
    str.backgroundColor="yellow";
    alert("Error!");
    return false;
    }
    return true;
    }function entr()
    {
    if(check())
    {
                            document.form1.submit();
                       }
    }这么写完后,正确的话也不SUBMIT了。。
      

  2.   

    如果return true的话,还是进不去if语句
      

  3.   

    问题已经解决了,我刚才没在check()里return
    多谢