<script type="text/javascript">
function $(id){
return document.getElementById(id);
}
function checkpwd(){
var pwd=$("password1").value;
var opwd=$("password4").value;
if(pwd==""){
$("passwordspan").innerHTML="旧密码不能为空";
return false;
}
if(pwd!=opwd){
$("passwordspan").innerHTML="旧密码填写不正确";
return false;
}
return true;
}
function checknewpwd(){
var npwd=$("password2").value;
if(npwd==""){
$("newpassword").innerHTML="新密码不能为空";
return false;
}
return true;
}
function checkoldpwd(){
var rpwd=$("password3").value;
var npwd=$("password2").value;
if(rpwd==""){
$("rpassword").innerHTML="验证密码不正确";
return false;
}
if(rpwd!=npwd){
$("rpassword").innerHTML="两次输入的密码不一致";
return false;
}
return true;
}
function checkit(){
if(checkpwd()&&checknewpwd()&&checkoldpwd()){
return true;
}
return false;
}
</script>
</head>
<body>
<div class="main">
<div class="optitle clearfix">
<div class="title">密码管理>></div>
</div>
<form id="form1" name="form1" method="post" action="doUpdatePassword.action" onSubmit="return checkit();">
<input type="hidden" name="flag" value="doAdd">
<div class="content">
<table class="box">
<tr>
<td class="field">旧的密码:</td>
<td><input type="password" name="password1" class="text" id="password1" onblur="checkpwd();" /> <font color="red"><span id="passwordspan"></span></font></td>
</tr>
<tr>
<td class="field">新的密码:</td>
<td><input type="password" name="password2" class="text" id="password2" onblur="checknewpwd();"/> <font color="red"><span id="newpassword"></span></font></td>
</tr><tr>
<td class="field">确认密码:</td>
<td><input type="password" name="password3" class="text" id="password3" onblur="checkoldpwd();" /> <font color="red"><span id="rpassword"></span></font></td>
</tr>
<tr>
<td><input type="hidden" name="userid" value="${user.userid}"/></td>
<td><input type="hidden" name="ps" id="password4" value="${user.password}"/><font color="red"><span id="passwordspan"></span></font></td>
</tr>
</table>
</div>
<div class="buttons">
<input type="submit" value="修改" onclick="return confirm('确认修改该密码信息吗?')" class="input-button"/>
<input type="button" onClick="window.history.go(-1);" value="返回" class="input-button"/>
</div>
</form>
</div>
</body>
</html>
function $(id){
return document.getElementById(id);
}
function checkpwd(){
var pwd=$("password1").value;
var opwd=$("password4").value;
if(pwd==""){
$("passwordspan").innerHTML="旧密码不能为空";
return false;
}
if(pwd!=opwd){
$("passwordspan").innerHTML="旧密码填写不正确";
return false;
}
return true;
}
function checknewpwd(){
var npwd=$("password2").value;
if(npwd==""){
$("newpassword").innerHTML="新密码不能为空";
return false;
}
return true;
}
function checkoldpwd(){
var rpwd=$("password3").value;
var npwd=$("password2").value;
if(rpwd==""){
$("rpassword").innerHTML="验证密码不正确";
return false;
}
if(rpwd!=npwd){
$("rpassword").innerHTML="两次输入的密码不一致";
return false;
}
return true;
}
function checkit(){
if(checkpwd()&&checknewpwd()&&checkoldpwd()){
return true;
}
return false;
}
</script>
</head>
<body>
<div class="main">
<div class="optitle clearfix">
<div class="title">密码管理>></div>
</div>
<form id="form1" name="form1" method="post" action="doUpdatePassword.action" onSubmit="return checkit();">
<input type="hidden" name="flag" value="doAdd">
<div class="content">
<table class="box">
<tr>
<td class="field">旧的密码:</td>
<td><input type="password" name="password1" class="text" id="password1" onblur="checkpwd();" /> <font color="red"><span id="passwordspan"></span></font></td>
</tr>
<tr>
<td class="field">新的密码:</td>
<td><input type="password" name="password2" class="text" id="password2" onblur="checknewpwd();"/> <font color="red"><span id="newpassword"></span></font></td>
</tr><tr>
<td class="field">确认密码:</td>
<td><input type="password" name="password3" class="text" id="password3" onblur="checkoldpwd();" /> <font color="red"><span id="rpassword"></span></font></td>
</tr>
<tr>
<td><input type="hidden" name="userid" value="${user.userid}"/></td>
<td><input type="hidden" name="ps" id="password4" value="${user.password}"/><font color="red"><span id="passwordspan"></span></font></td>
</tr>
</table>
</div>
<div class="buttons">
<input type="submit" value="修改" onclick="return confirm('确认修改该密码信息吗?')" class="input-button"/>
<input type="button" onClick="window.history.go(-1);" value="返回" class="input-button"/>
</div>
</form>
</div>
</body>
</html>