<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<script type="text/javascript">
function changePass(){
var userPass=document.from_editEmail.userPass.value;
var oldPass=document.from_editEmail.oldPass.value;
if(oldPass==userPass){
return true;
}else{
alert('原始密码错误,请重新输入');
document.from_editEmail.oldPass.value='';
return false;
}
}
function submitEditEmail(){
if(document.from_editEmail.oldPass.value==''){
alert('原始密码不能为空');
return false;
}else if(!changePass()){
return false;
}else if(document.from_editEmail.newEmail.value==''){
alert('新邮箱不能为空');
return false;
}
var newEmail=document.from_editEmail.newEmail.value;
if(newEmail.indexOf('@')<1 || (newEmail.indexOf('.')<(newEmail.indexOf('@')+1))){
alert('邮箱格式不正确');
return false;
}
document.from_editEmail.submit();
}
</script>
<div class="l_t_4">
<form action="user.do" name="from_editEmail" method="post">
<input type="hidden" name="userAction" value="ediUserEmail"/>
<div class="c1"> <span class="font1">修改我的注册密码</span></div>
<div class="c6" style="padding-left:100px;">
<div class="lt_con">
<div class="lt_left">用户名:</div>
<div class="lt_right">
<input type="text" name="userName" value="${user.userName}" id="txtUA" class="in" style="width: 148px" disabled="disabled"/>
</div>
</div>
</div>
<div class="c6" style="padding-left:100px;">
<div class="lt_con">
<input type="hidden" name="userPass" value="${user.userPassword}"/>
<div class="lt_left">用户密码:</div>
<div class="lt_right"><input type="password" name="oldPass" id="txtOldPwd" class="in" style="width: 148px" οnchange="changePass()" /></div>
</div>
</div>
<div class="c6" style="padding-left:100px;">
<div class="lt_con">
<div class="lt_left">新邮箱:</div>
<div class="lt_right">
<input type="text" name="newEmail" class="in" style="width: 147px" /><br/>
<span style="color:#f00;font-size:12px;">邮箱格式必须包含'@'和'.'并且不能以'@'开头'@'和'.'之间至少有一个字符</span>
</div>
</div>
</div>
<div class="lt_con" style="padding-left:150px;">
<img src="images/bt5[1].gif" οnclick="submitEditEmail()" />
</div>
</form>
</div>