<head runat="server">
    <title></title>
    <script type="text/javascript" language="JavaScript">
        function checkform() {
            if (document.getElementById('usrname').value == "") {
                window.alert("请输入您的用户名!");
                document.Log.usrname.focus();
                return false;
            }
            var patrn = /^[a-zA-Z0-9 ]{5,20}$/;
            if (!patrn.exec(document.getElementById('usrname').value)) {
                window.alert("用户名只能由字母或者数字组成,并且不能少于5个字符,不能大于20个字符!");
                document.getElementById('usrname').focus();
                return false
            }
            if (document.getElementById('passwd').value == "") {
                window.alert("请输入您的密码!");
                document.getElementById('passwd').focus();
                return false;
            }
            if ((document.getElementById('passwd').value.length < 6) || (document.getElementById('passwd').value.length > 20)) {
                window.alert("登录密码不能少于6个字符,不能多于20个字符!");
                document.getElementById('passwd').focus();
                return false;
            }
            Log.submit.disabled = true;
            return true;
        }
</script>
</head>

方法一: HTML控件

<body>
    <form />
    </div>
    </form>
</body>

方法二:服务器控件

<body>
    <form />
    </div>
    </form>
</body>

相关文章:

  • 2021-09-08
  • 2021-08-06
  • 2021-08-17
  • 2022-02-22
  • 2021-08-13
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-06-18
  • 2022-03-08
相关资源
相似解决方案