是mail.T1.value非mail.T1.Values太大意了

解决方案 »

  1.   

    哈哈,values-->value揭贴吧,算我一份
      

  2.   

    <script language=javascript>
     <!--
     function mails(mail)
     {
     if(mail.T1.value=="")//注意:此处没有S(value)
     {
     alert("is null");
     }
     else
     {
     alert("not null");
     }
     
     }
     //-->
    </script></head><body><form method="POST" action="">
       <input type="text" name="T1" size="20" >
       <input type="submit" value="提交" name="B1" onclick="mails(this.form)"></p>
    </form>
      

  3.   

    多了个S,另外最好 OnClick="return mails(thsi.form)",在前面的函数中加入return true,return false
      

  4.   

    最好是
    if(mail.T1.value.replace(/\s/,"")=="")否则你按space键后
    mail.T1.value==""便不成立了