解决方案 »

  1.   

    即使把else { _result = true; } 去掉,也依然执行
      

  2.   

    问题是我都没看见你写return啊
      

  3.   

    写什么return啊,在哪写,我不懂javascript,这代码是我改别人的        
      

  4.   

        function checkUID(x,y) {
               var _result = false;  
    你只定义一个_result ,但是你什么时候return这个_result 了?
      

  5.   

    <script type="text/javascript">
            function checkUID(x,y) {
                     var _txt1 = document.getElementById("txt_username"); 
                     var _txt2 = document.getElementById("txt_pwd");
                     if (_txt1.value == "") {  
                      alert("请输入用户名和密码");
                      return false;
                  } 
                  if ( _txt2.value == "")
                  { 
                     alert("请输入密码");
                     return false;
                  }
                  return true;
                  }
        </script>
      

  6.   

    <script type="text/javascript">
            function checkUID(x,y) {
                     var _txt1 = document.getElementById("txt_username"); 
                     var _txt2 = document.getElementById("txt_pwd");
                     if (_txt1.value == ""|| _txt2.value == "") {  
                      alert("请输入用户名和密码");
                      return false;
                  } 
                  return true;
                  }
        </script>