123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/webpage/include/taglibf.jsp"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>${fns:getConfig("productName")}</title>
- <link rel="stylesheet" href="${ctxStaticWeb}/css/base.css" />
- <link rel="stylesheet" href="${ctxStaticWeb}/css/second.css" />
- <script src="${ctx}/static/web/js/jquery-2.1.4.js"></script>
- <script src="${ctx}/static/plugin/jquery-validation/1.14.0/jquery.validate.js" type="text/javascript"></script>
- <script src="${ctx}/static/plugin/jquery-validation/1.14.0/localization/messages_zh.min.js" type="text/javascript"></script>
- <script src="${ctxStatic}/plugin/layui/layer/layer.js"></script>
- <script src="${ctxStatic}/plugin/layui/laytpl/laytpl.js"></script>
- <script>
- $().ready(function() {
- $("#inputForm").validate({
- debug: false,
- focusInvalid: true, //当为false时,验证无效时,没有焦点响应
- onkeyup: false,
- rules: {
- password: {
- required: true,
- minlength: 6,
- remote: "${ctx}/validatePassword"
- },
- passwordAgain: {
- required: true,
- minlength: 6
- },
- passwordAgain1: {
- required: true,
- minlength: 6,
- equalTo: "#passwordAgain"
- }
- },
- messages: {
- password: {
- required: "请输入原密码",
- minlength: "原密码长度不能小于6位",
- remote:"原密码错误"
- },
- passwordAgain: {
- required: "请输入确认密码",
- minlength: "密码长度不能小于6位"
- },
- passwordAgain1: {
- required: "请输入确认密码",
- minlength: "密码长度不能小于6位",
- equalTo: "两次密码输入不一致"
- }
- },
- submitHandler:function(form){//这是关键的语句,配置这个参数后表单不会自动提交,验证通过之后会去调用的方法
- $.ajax({
- url:"${ctx}/updatePassword",
- type:"POST",
- cache: false,
- data:$(form).serialize(),
- dataType:"json",
- beforeSend: function(XMLHttpRequest){
- //do something before submit...
- },
- success: function(data){
- if(data.success){
- layer.msg(data.msg, {icon:1});
- document.getElementById("inputForm").reset();
- }else{
- layer.msg(data.msg, {icon:2,time: 2000});
- }
- },
- complete: function(XMLHttpRequest, textStatus){
- //do something in the end...
- }
- });
- }
- });
- //增加手机号验证规则
- $.validator.addMethod("isMobile", function(value, element) {
- var length = value.length;
- var mobile = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/;
- return this.optional(element) || (length == 11 && mobile.test(value));
- }, "请正确填写您的手机号码");
- });
- </script>
- <style>
- .information ul li input{width:248px;line-height:40px;padding:0px 10px;color:#999;border:1px solid #999;}
- #inputForm label.error{
- color:#cc5965;
- font-size:14px;
- padding: 10px;
- }
- </style>
- </head>
- <body>
- <%@ include file="/webpage/modules/web/top.jsp"%>
-
- <div class="new w clearfix">
- <div class="personal">
- <div class="personal_l fl">
- <h2>个人中心</h2>
- <ul>
- <li><a href="${ctxF}/info" id="hrefperson">个人资料</a></li>
- <li><a href="${ctxF}/personalpwd" id="hrefpwd" class="do">修改密码</a></li>
- <li><a href="${ctxF}/count" id="hrefCount">学习统计</a></li>
- <li><a href="${ctxF}/history" id="hrefhistory">答题测试</a></li>
- <li><a href="${ctxF}/exam/wait" id="hrefexam">在线考试</a></li>
- <li><a href="${ctxF}/plan" id="hrefplan">培训计划</a></li>
- <li><a href="#" onclick="exit()">退出登录</a></li>
- </ul>
- </div>
- <div class="personal_r fr">
- <div class="position">当前位置:<a href="${ctx}/">网站首页</a> > 个人中心 > 修改密码</div>
- <div class="information" id="xgmm" >
- <form id = "inputForm" method="post">
- <ul>
- <li><span>登录名:</span>${applicationScope.talentPerson.loginName}</li>
- <li><span>旧密码:</span><input type="password" name="password" id="password" style="border:1px solid #999;" placeholder="请输入旧密码"></li>
- <li><span>新密码:</span><input type="password" name="passwordAgain" id="passwordAgain" placeholder="输入新密码"></li>
- <li><span>确认密码:</span><input type="password" name="passwordAgain1" id="passwordAgain1" placeholder="输入新密码"></li>
- </ul>
- <div style="width:530px; margin: 0 auto;">
- <input type="submit" value="保 存" style="cursor: pointer;height:44px;border-radius: 4px;font-size:16px;color:#fff; background-color: #C7301E; width: 150px;border:none">
- </div>
- </form>
- </div>
- </div>
- </div>
-
- </div>
- <div class="footer">
- <%@ include file="/webpage/modules/web/footer.jsp"%>
- </div>
- </body>
- </html>
|