登陆界面

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>三杰</title>
    <link type="text/css" rel="stylesheet" th:href="@{/css/style.css}" href="/css/style.css" />
    <link type="text/css" rel="stylesheet" th:href="@{/css/public.css}" href="/css/public.css" />
</head>
<body class="login_bg">
<section class="loginBox">
    <header class="loginHeader">
        <h1></h1>
    </header>x`
    <section class="loginCont">
        <form class="loginForm" action="#" th:action="@{/login/loginck}" name="actionForm" id="actionForm"
              th:object="{user}" method="post"  onsubmit="return loginck()">
            <div class="info"></div>
            <div class="info" th:text="{errLogin}"></div>
            <div class="inputbox">
                <label>用户名:</label>
                <input type="text" class="input-text" th:field="*{username}" name="username" placeholder="请输入用户名" required/>
            </div>
            <div class="inputbox">
                <label>密    码:</label>
                <input type="password" th:field="*{userpassword}" placeholder="请输入密码" name="userpassword" required/>
            </div>
            <div class="subBtn">
                <input type="submit" value="登录"/>
                <input type="reset" value="重置"/>
            </div>
        </form>
    </section>
</section>
</body>
<script type="text/javascript" th:src="@{/static/js/jquery-1.8.3.min.js}" src="/static/js/jquery-1.8.3.min.js" src="/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
    function loginck() {
        (".info").html("用户名至少需要4位");
      var test=document.getElementsByName("username");
      varusername =("#username").val();
      var username =test.innerHTML;
      alert(username);
      varuserCode =  ("#userCode").val();
      varuserPassword =  ("#userPassword").val();
     if(userCode.length<4){
         (".info").html("用户名至少需要4位");
         alert("cuowu");
         return  false;
     }else if(userPassword.length<4){
         (".info").html("密码至少需要4位");
         return  false;
     }(".info").html("");
        return true;
    }
</script>
</html>