当前位置: 移动技术网 > IT编程>开发语言>.net > .net js验证为空j时,不让button执行onclick事件

.net js验证为空j时,不让button执行onclick事件

2018年03月30日  | 移动技术网IT编程  | 我要评论

携女友开房遭偷窥,6070电影下载,少昊的使者

<script type ="text/javascript" language="javascript">
           function checkInput() {        
          var strMsg = "";
          var userName = document.getElementById("<%=txt_Uer.ClientID%>").value;
          var password = document.getElementById("<%=txt_Password.ClientID%>").value;
          var txt_key = document.getElementById("<%=txt_key.ClientID%>").value;      
          if (userName == "" || userName == null) {
              strMsg = "用户名"
          }
          if (password == "" || password == null) {
              strMsg += " 密码"
          }
          if (txt_key == "" || txt_key == null) {
              strMsg += " 验证码"
          }
          if (strMsg != "") {
              alert(strMsg + " 不能为空!");
              return false;
          }
      }
    </script>

   <asp:Button ID="Button1" runat="server" Text="登录" onclick="Button1_Click" OnClientClick="return checkInput()" />

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网