<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改密碼</title>
<link href="${pageContext.request.contextPath}/css/main.css"
rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/base.css"
rel="stylesheet" type="text/css" />
<script src="${pageContext.request.contextPath}/js/jquery.js"></script>
</head>
<body>
<div class="rihgt_memu">
<div class="container" style="height: 560px;">
<div class="tab_list">
<h2>修改密碼</h2>
<div class="table2">
<form action="" name="querForm" id="querFormId" method="post">
<input type="hidden" name="id" id="id" value="${manager.id}" />
<table width="80%" class="fieldset" border="0" cellpadding="0"
cellspacing="0" style="margin-top: 15px; height: 200px;">
<tr>
<td width="33%" align="right" class="gray"><label>
<span id="span1">${msg}</span> 舊密碼
</label></td>
<td align="left"><span> <input type="password"
name="password" id="password" value="${password}"
class="input_text_300" maxlength="12" onblur="oldpasword();" />
<span id="div1" style="color: #bbb;">請輸入您以前的密碼</span></span></td>
</tr>
<tr>
<td align="right" class="gray"><label> <span
id="span2"></span> 新密碼
</label></td>
<td align="left"><span> <input type="password"
name="newpaswd" id="newpaswd" value="${newpaswd}"
class="input_text_300" maxlength="12" onblur="newpassword();" />
<span style="color: #bbb;">可由英文/數(shù)字/特殊字符組成,長度在6到12個字符</span></span></td>
</tr>
<tr>
<td align="right" class="gray"><label> <span
id="span3"></span>確認新密碼
</label></td>
<td align="left"><span> <input type="password"
name="rnewpaswd" id="rnewpaswd" value=""
class="input_text_300" maxlength="12" onblur="againPaswrd();" />
<span style="color: #bbb;">請再次輸入新的密碼,必須與新密碼保持一致</span></span></td>
</tr>
<tr height="50">
<td colspan="4" align="right"
class="no_left_border no_bottom_border no_right_border">
<div
style="clear: both; text-align: center; margin-top: 10px; margin-bottom: 10px;">
<input name="sub2" id="sub2" style="color: #fff;"
type="button" class="button_bg2"
onMouseOver="this.className='button_bg2_on'"
onmouseout="this.className='button_bg2'"
value="提交修改" />
</div>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
<!-- 彈出層 -->
<div id="div_repeat" class="repeatdiv" style="visibility: hidden;">
<div class="repeatdiv_title">
<a href="#" onclick="updateclose();"><img
src="${pageContext.request.contextPath}/p_w_picpaths/X_icon.gif"
style="margin: 5px 5px 0 0;" /></a>
</div>
<div class="repeatdiv_table">
<table width="100%" cellpadding="0" cellspacing="0"
id="advance_table" border="0">
<input type="hidden" id="mesidhid" value="" />
<tr>
<td align="right"><img id="imgiss"
src="${pageContext.request.contextPath}/p_w_picpaths/login_success_ico.gif"
width="24" height="24" /></td>
<td align="left"><span id="uppaswordId"
style="font-size: 12px; font-weight: bold; color: #0a6505;"></span></td>
</tr>
</table>
</div>
</div>
</body>
<script language="javascript">
//驗證舊密碼格式
var regrpwd = /^[\@A-Za-z0-9\!\#\$\%\^\&\*\.\~]{6,12}$/;
function oldpasword() {
var password = $("#password").val();
if(password.length>0&&!regrpwd.test(password)) {
$("#span1").empty();
$("#span1").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/fail.gif'/>");
return;
}else if(password.length>0&®rpwd.test(password)){
$("#span1").empty();
$("#span1").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/sucess.gif'/>");
return;
}
else if(password.length==0) {
$("#span1").empty();
return;
}
}
//驗證新密碼格式
function newpassword() {
var newpaswd = $("#newpaswd").val();
if(newpaswd.length>0&&!regrpwd.test(newpaswd)) {
$("#span2").empty();
$("#span2").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/fail.gif'/>");
return;
}
else if(newpaswd.length>0&®rpwd.test(newpaswd)){
$("#span2").empty();
$("#span2").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/sucess.gif'/>");
return;
}
else if(newpaswd.length==0){
$("#span2").empty();
return;
}
}
//驗證再次輸入的密碼與新密碼是否一致
function againPaswrd() {
if($("#rnewpaswd").val().length>0&&!regrpwd.test($("#rnewpaswd").val())){
$("#span3").empty();
$("#span3").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/fail.gif'/>");
return;
}
else if($("#newpaswd").val()!=$("#rnewpaswd").val()) {
$("#span3").empty();
$("#span3").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/fail.gif'/>");
return;
}else if($("#rnewpaswd").val().length>0&®rpwd.test($("#rnewpaswd").val())){
$("#span3").empty();
$("#span3").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/sucess.gif'/>");
return;
}
else if($("#rnewpaswd").val().length==0) {
$("#span3").empty();
return;
}
}
//提交修改
function setPassword() {
var password = $("#password").val();
var newpaswd = $("#newpaswd").val();
var rnewpaswd = $("#rnewpaswd").val();
var i=0;
//驗證登陸名
if(!regrpwd.test(password)) {
$("#span1").empty();
$("#span1").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/fail.gif'/>");
i=1;
}
/* else {
$("#span1").empty();
$("#span1").html("<img src='/beyondsoft/p_w_picpaths/sucess.gif'/>");
} */
if(!regrpwd.test(newpaswd)) {
$("#span2").empty();
$("#span2").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/fail.gif'/>");
i=1;
}
/* else{
$("#span1").empty();
$("#span1").html("<img src='/beyondsoft/p_w_picpaths/sucess.gif'/>");
} */
if(!regrpwd.test(rnewpaswd)) {
$("#span3").empty();
$("#span3").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/fail.gif'/>");
i=1;
}
else if(rnewpaswd!=newpaswd) {
$("#span3").empty();
$("#span3").html("<img src='${pageContext.request.contextPath}/p_w_picpaths/fail.gif'/>");
i=1;
}
if(i==0){
$.ajax({//post方式可以提交中文不會出現(xiàn)亂碼.get會出現(xiàn)亂碼
url : "${pageContext.request.contextPath}/admin/manager/setpaswd",
type : "post",
data : {upassword:password,unewpaswd:newpaswd},
success : function(fdata) {
if( fdata==0 ) { //表示原密碼輸入錯誤
$("#mesidhid").val(0);
$("#uppaswordId").css("color","red").text("舊密碼輸入錯誤");
$("#imgiss").attr("src","${pageContext.request.contextPath}/p_w_picpaths/error_ico.jpg");
var content = window.document.getElementById("div_repeat");
//彈出(設置透明度為1并且visibility為visible)
content.style.opacity = "1";
content.style.visibility = "visible";
$(content).css("left",$('#div1').offset().left).css("top",$('#div1').offset().top);
//3秒自動消失(設置透明度先為1后為0并且visibility為hidden)
$("#div_contents4").fadeTo(3000,1,function(){
content.style.opacity = "0";
content.style.visibility="hidden";
});
}
else if(fdata == -1) {
$("#mesidhid").val(-1);
$("#uppaswordId").css("color","red").text("發(fā)生異常,密碼修改失敗");
$("#imgiss").attr("src","${pageContext.request.contextPath}/p_w_picpaths/error_ico.jpg");
var content = window.document.getElementById("div_repeat");
//彈出(設置透明度為1并且visibility為visible)
content.style.opacity = "1";
content.style.visibility = "visible";
$(content).css("left", ($(window.document.body).width() - $(content).width()) / 2);
//3秒自動消失(設置透明度先為1后為0并且visibility為hidden)
$("#div_contents4").fadeTo(3000,1,function(){
content.style.opacity = "0";
content.style.visibility="hidden";
});
}
else if(fdata == 1) {
$("#mesidhid").val(1);
$("#uppaswordId").css("color","red").text("密碼修改成功");
$("#imgiss").attr("src","${pageContext.request.contextPath}/p_w_picpaths/login_success_ico.gif");
var content = window.document.getElementById("div_repeat");
//彈出(設置透明度為1并且visibility為visible)
content.style.opacity = "1";
content.style.visibility = "visible";
$(content).css("left", ($(window.document.body).width() - $(content).width()) / 2);
//3秒自動消失(設置透明度先為1后為0并且visibility為hidden)
$("#div_contents4").fadeTo(3000,1,function(){
content.style.opacity = "0";
content.style.visibility="hidden";
});
window.setTimeout("relogin('${pageContext.request.contextPath}/admin/login')",3100);
}
}
});
}
}
//關閉彈出的刪除提示層
function updateclose() {
var content3 = document.getElementById("div_repeat");
content3.style.visibility="hidden";
if($("#mesidhid").val()==1){
relogin('${pageContext.request.contextPath}/admin/login');
}
}
function relogin(logurl) {
location.href=logurl;
}
</script>
</html>
成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設,碾子山企業(yè)網(wǎng)站建設,碾子山品牌網(wǎng)站建設,網(wǎng)站定制,碾子山網(wǎng)站建設報價,網(wǎng)絡營銷,網(wǎng)絡優(yōu)化,碾子山網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力。可充分滿足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學習、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。
網(wǎng)站名稱:彈出層--jquery定位小例子
鏈接地址:http://jinyejixie.com/article32/jjgcpc.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供電子商務、網(wǎng)站設計、、軟件開發(fā)、域名注冊、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)