Try:
document.form1.yb.value.length<6

解决方案 »

  1.   

    function checkinput()
    {
          if(document.form1.yb.value.length<6)  //少了个.value
    {
      window.alert("您输入邮编错误")
      document.form1.yb.focus();
      return false;
     }
    }
      

  2.   

    改成这样:
    <form method="POST" name="form1"  >邮编<INPUT class="style1" maxlength=16 name=yb  typt="text">
    <input type=submit value="Submit" onclick="checkinput()">
    </form>
    <SCRIPT language=javascript>
    <!--
    function checkinput()
    {
          if(document.form1.yb.value.length<6)
    {
      window.alert("您输入邮编错误")
      document.form1.yb.focus();
      return false;
     }else
    {
    form1.submit();
    }
    }
    -->
    </script>
      

  3.   


    document.form1.yb.length //只是说明控件本身的长度   ×document.form1.yb.value.length //控件中输入值的长度 ○
      

  4.   

    谢谢两位就只是少了个value可是我该把分给谁哩,不知道了