<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master/User.Master" CodeBehind="UpdatePwd.aspx.vb" Inherits="Dingtai.Website.UpdatePwd" title="密码修改"%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="body_left">
<div class="body_left_top"></div>
<div id="body_left_conter">
<div id="upload_title" style="color:#FFF;">密码修改
  <div class="back"><a href="javascript:history.back(-1)">返回上页</a></div>
</div>

<div id="msgError" ></div>
<div class="Password">
<p>请先填写您目前的登陆密码，密码验证正确方能修改注册信息</p>
<div class="Old">旧密码：<input name="uopwd" id="uopwd" runat="server" type="password" /></div>
<div class="New_box">
<span>注册资料修改（某项为空时将不修改该项）</span>
<div class="New">
<div>&nbsp;&nbsp;&nbsp;&nbsp;E-mail：<input name="uemail" id="uemail" runat="server" type="text" /></div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;新密码：<input name="upwd" id="upwd" runat="server" type="password" /></div>
<div>重复新密码：<input name="ucpwd" id="ucpwd" runat="server" type="password" /></div>
</div>
</div>
<div class="Modify_an"><asp:ImageButton ImageUrl="/html/Skins_user/default/images/Modify_an.gif" ID="imgbt_update"             runat="server" OnClientClick="return checkPass();"/></div>
</div>
</div>
<div class="body_left_bottom"></div>
</div>

<script type="text/javascript">
	function checkPass()
	{
		var uemail = document.getElementById("ctl00_ContentPlaceHolder1_uemail");
		var opass  = document.getElementById("ctl00_ContentPlaceHolder1_uopwd");
		var fpass = document.getElementById("ctl00_ContentPlaceHolder1_upwd");
		var tpass = document.getElementById("ctl00_ContentPlaceHolder1_ucpwd");
		var msg = document.getElementById("msgError");
		var flag = true;
				
		msg.innerHTML = "";
		
		if (opass.value.length = 0) { msg.innerHTML = '旧密码不能为空.'; flag = false; }
		if (flag && opass.value.length < 6) { msg.innerHTML = '旧密码长度需小于6.'; flag = false; }
		
		if (flag && fpass.value.length < 6) { msg.innerHTML = '密码长度需小于6.'; flag = false; }
		
		if (flag && fpass.value != tpass.value) { msg.innerHTML = '二次密码输入不一致.'; flag = false; }
		
//		if (flag && uemail.value.length < 1) { msg.innerHTML = 'email不能为空.'; flag = false; }
		
		//Email验证
		var regEmail = new RegExp(/^\w+([.+-]\w+)*@\w+([-+]\w+)*\.(com|cn|net|org|edu|mil|tv|biz|info)$/);
		if(flag && uemail.value.length > 0 && !regEmail.test(uemail.value))
		{
			msg.innerHTML = 'email格式不正确.';
			flag = false;
		}
			
		if (!flag) { msg.style.display = "block";}
		return flag;
	}
</script>
</asp:Content>