<{import file="member/reg_header.html" title="修改密码"}>
<div class="regbox_bar"> 
	<div class="regbox"> 
		<form action="#" method="post"> 
			<div class="reg_con">
				<div id="error_msg" style="display:none;"></div> 
				<div class="rbox_input">
					<span>新&nbsp;密&nbsp;码</span>
					<input type="password" name="password" id="password" placeholder="新设置的密码"/> 
				</div> 
				<div class="rbox_input">
					<span>重复密码</span>
					<input type="password" name="repasswd" id="repasswd" placeholder="重复新设置的密码"/> 
				</div> 
				<div class="rbox_sub"><input type="submit" name="submit" class="submit_reg" value="重置密码"/></div>	
			</div>
		</form> 
	</div>	 
</div>  
<{import file="member/footer.html"}>
<script type="text/javascript"> 
$(function(){ 
	$("form").submit(function(){
		password = $("#password").val(); 
		if(password == ''){ $("#error_msg").show().html('密码不能为空'); return false; } 
		
		repasswd = $("#repasswd").val(); 
		if(repasswd == ''){ $("#error_msg").show().html('重复密码不能为空'); return false; } 
		
		if(password != repasswd){
			$("#error_msg").show().html('两次密码输入不一致'); return false;
		}
		$.ajax({
			type:'POST',
			url:URI+'member/forget_reset_submit',
			data:{password:password, repasswd:repasswd}, 
			success:function(result){ 
				var data = jQuery.parseJSON(result); 
				if(data.error == 0){
					$.alert('修改成功', function(){
						location.href = URI+"member/login";
					}); 
				}else{ 
					$.alert(data.msg);
				}
			},error:function(){
				$.alert('错误');
			}
		});
		return false; 
	}); 
});
</script>