136 lines
4.8 KiB
Plaintext
136 lines
4.8 KiB
Plaintext
|
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
|||
|
|
<%@ include file="/webpage/include/taglib.jsp"%>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<title>修改密码</title>
|
|||
|
|
<meta name="decorator" content="default"/>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
$(document).ready(function() {
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(function () {
|
|||
|
|
$("#inputForm").submit(goUpdatePWD);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function beforeSubmit(form){
|
|||
|
|
var newPWD = $("#password").val();
|
|||
|
|
if(newPWD == ''){
|
|||
|
|
alert('密码不能为空!');
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
var checkPWD = $("#checkPWD").val();
|
|||
|
|
if(checkPWD == ''){
|
|||
|
|
alert('密码不能为空!');
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (newPWD != checkPWD){
|
|||
|
|
alert('两次输入的密码不一致!');
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
setPassword(newPWD);
|
|||
|
|
|
|||
|
|
// $("#inputForm").submit();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
//表单options
|
|||
|
|
var options = {
|
|||
|
|
//提交前的回调函数,用于检查表单内容是否合法
|
|||
|
|
beforeSubmit:validate,
|
|||
|
|
//请求路径
|
|||
|
|
url:"${ctx}/login",
|
|||
|
|
//请求方式,默认get
|
|||
|
|
type:"get",
|
|||
|
|
//包含额外数据的对象通过 form 形式提交。
|
|||
|
|
data:{"updatePWD":"1"},
|
|||
|
|
//服务器响应的数据类型,可以是 null、xml、script 或者 json。
|
|||
|
|
dataType:"json",
|
|||
|
|
//请求成功的回调函数
|
|||
|
|
success: {},
|
|||
|
|
//错误时的回调函数
|
|||
|
|
error:{} ,
|
|||
|
|
//清空表单
|
|||
|
|
clearForm:true,
|
|||
|
|
//重置表单
|
|||
|
|
resetForm:true,
|
|||
|
|
//延迟时间
|
|||
|
|
timeout:10000
|
|||
|
|
};
|
|||
|
|
//表单提交前的回调函数:处理问题数据
|
|||
|
|
function validate(formData,jqForm,options) {
|
|||
|
|
var form = jqForm[0];
|
|||
|
|
if (!form.password.value){
|
|||
|
|
alert("新密码不能为空");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
if (!form.checkPWD.value){
|
|||
|
|
alert("确认密码不能为空");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
if (form.checkPWD.value != form.password.value){
|
|||
|
|
alert("两次输入的密码不一致");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
//表单内容序列化
|
|||
|
|
var queryString = $.param(formData);
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function goUpdatePWD() {
|
|||
|
|
$(this).ajaxSubmit(options);
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<form:form id="inputForm" name="form" modelAttribute="user" method="get" class="form-horizontal form-group">
|
|||
|
|
<%--<form:form id="inputForm" name="form" modelAttribute="user" action="${ctx}/sys/changePwd/updatePWD" onSubmit="return beforeSubmit" method="post" class="form-horizontal form-group">--%>
|
|||
|
|
<form:hidden path="id"/>
|
|||
|
|
<sys:message hideType="1" content="${message}"/>
|
|||
|
|
<div class="control-group">
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="control-group">
|
|||
|
|
<input type="hidden" value="1" name="updatePWD">
|
|||
|
|
<div class="control-group">
|
|||
|
|
<label class="col-sm-3 control-label"><font color="red">*</font>新密码:</label>
|
|||
|
|
<div class="controls">
|
|||
|
|
<input id="password" name="password" type="text" value="" class="form-control max-width-250 required"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="control-group">
|
|||
|
|
<label class="col-sm-3 control-label"><font color="red">*</font>确认密码:</label>
|
|||
|
|
<div class="controls">
|
|||
|
|
<input id="checkPWD" name="checkPWD" type="text" value="" class="form-control max-width-250 required"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<%-- <div class="control-group">
|
|||
|
|
<label class="col-sm-3 control-label"><font color="red">*</font>验证码 :</label>
|
|||
|
|
<div class="controls">
|
|||
|
|
<input id="checkCode" name="checkCode" type="text" value="" class="form-control max-width-250 required"/>
|
|||
|
|
<span>
|
|||
|
|
<img src="${ctx}/sys/changePwd/createImg" onclick="this.setAttribute('src','${ctx}/sys/changePwd/createImg?x='+Math.random())" alt="验证码" title="点击更换" />
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
</div>--%>
|
|||
|
|
<div style="margin-left: 100px;" class="control-group">
|
|||
|
|
<%--<input type="button" value="提交" maxlength="70" minlength="5" onclick="beforeSubmit();"/>--%>
|
|||
|
|
<input type="submit" value="提交" maxlength="70" minlength="5" />
|
|||
|
|
<input type="reset" value="重置" maxlength="70" minlength="5" />
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-actions">
|
|||
|
|
<input id="btnSubmit" class="btn btn-primary" type="submit" style="display:none" value="保 存"/>
|
|||
|
|
</div>
|
|||
|
|
</form:form>
|
|||
|
|
</body>
|
|||
|
|
</html>
|