@{
    ViewBag.Title = "RevisePassword";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    layui.use(['jquery', 'form', 'common', 'optimizeSelectOption'], function () {
        var form = layui.form,
            common=layui.common,
            $ = layui.$;
        //自定义验证规则
        form.verify({
             equal: function (value, item) { //value：表单的值、item：表单的DOM对象
                if (value != layui.$('input[name="F_UserPassword"]').val()) {
                    return '密码不相同请重新输入！'
                }
            },
            pass: function (value, elem) {
                var EXP = /^[\S]{6,12}$/;
                if (value && !EXP.test(value)) {
                    return '密码必须6到12位，且不能出现空格';
                }
            }
        });
        wcLoading.close();
        //监听提交
        form.on('submit(saveBtn)', function (data) {
                var postData = data.field;
                common.submitForm({
                    loading: "正在修改数据...",
                    url: "/SystemOrganize/User/SubmitReviseSelfPassword",
                    param: postData,
                    success: function () {
                    }
                })
            return false;
        });
    });
</script>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form layuimini-form" lay-filter="useradmin">
            <div class="layui-form-item">
                <label class="layui-form-label">新密码</label>
                <div class="layui-input-block">
                    <input type="password" id="F_UserPassword" name="F_UserPassword" lay-verify="required|pass" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码</label>
                <div class="layui-input-block">
                    <input type="password" id="F_UserPasswordNew" name="F_UserPasswordNew" lay-verify="required|pass|equal" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <button class="layui-btn site-demo-active" lay-submit id="submit" lay-filter="saveBtn">确认保存</button>
            </div>
        </div>
    </div>
</div>
