<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增忘记密码申请')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-forgetPassword-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">登录名：</label>
                <div class="col-sm-8">
                    <input name="loginName" class="form-control" type="text" required>
                </div>
            </div>





            <div class="form-group">    
                <label class="col-sm-3 control-label">期望密码：</label>
                <div class="col-sm-8">
                    <input name="expectPassword" class="form-control" type="password" id="expectPassword"  >
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label">确认密码：</label>
                <div class="col-sm-8">
                    <input name="confirmPassword" class="form-control" type="password" id="confirmPassword">
                </div>
            </div>


            <button onclick="submitHandler()" class="btn btn-success btn-block" id="btnSubmit" data-loading="正在验证注册，请稍后...">提交</button>




        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/forgetPassword"
        $("#form-forgetPassword-add").validate({
            rules:{
                expectPassword: {
                    required: true,
                    minlength: 8,
                    maxlength: 8
                },
                confirmPassword: {
                    required: true,
                    equalTo: "#expectPassword"
                },
            },
            messages: {

                expectPassword: {
                    required: "请输入期望密码",
                    minlength: "密码为8位字符",
                    maxlength: "密码为8位字符"
                },
                confirmPassword: {
                    required: "请再次输入确认密码",
                    equalTo: "两次密码输入不一致"
                }

            },






            focusCleanup: true
        });

        function submitHandler() {
            console.log(1111)
            if ($.validate.form()) {
                $.operate.save(prefix + "/addSave", $('#form-forgetPassword-add').serialize());
            }
        }

    </script>
</body>
</html>