<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>用户注册</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/resource/js/validate.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/resource/js/jquery.js"></script>
<script language="JavaScript">
//同意服务
function isaccepted(){
if(document.getElementById("check_id").checked==true){
document.getElementById("sub").disabled = false;
}else{
document.getElementById("sub").disabled = true;
}
}
//保存数据前校验
function checkuser() {
//alert("aa");
var value = $("#eamil").attr("value");
$("#emailMsg").html("");
if (checkIsEMail(value)) {
$("#emailMsg").attr("style", "color:red");
$("#emailMsg").html("邮箱已存在/错误!");
return false;
}
var password = $("#password").attr("value")
var wpassword = $("#wpassword").attr("value")
$("#pwdMsg").html("");
$("#wpwdMsg").html("");
if (checkIsEmpty(password)) {
$("#pwdMsg").attr("style", "color:red");
$("#pwdMsg").html("密码不能为空!");
return false;
}
if (password != wpassword) {
$("#wpwdMsg").attr("style", "color:red");
$("#wpwdMsg").html("密码不一致,请重新输入!");
return false;
}
var verfy = $("#verify").attr("value")
$("#verMsg").html("");
if(checkIsEmpty(verfy)){
$("#verMsg").attr("style", "color:red");
$("#verMsg").html("验证码不能为空!");
return false;
}
}
//换张验证码
function nChange() {
var dt = new Date();
var image = document.getElementById("imgVerify");
image.src = "${pageContext.request.contextPath}/common/RandVerifyImg.jsp?ts="+dt;
}
</script>
</head>
<body>
<form name="form1" method="post" action="${pageContext.request.contextPath}/sysadmin/edit_mem.action " >
<%--<s:form name="form1" method="post" action="edit_mem.action" namespace="/sysadmin" >--%>
<table>
<div class="mtitle" >
<div class="mtitle-row"> </div>
用户注册
</div>
<br>
<br>
<tr>
<td><div align="right">注册邮箱:</div>
</td>
<td><input name="email" id="eamil" type="text" οnblur="return checkuser();"/> <span
id="emailMsg"></span>
</td>
</tr>
<tr>
<td><div align="right">密码:</div>
</td>
<td><input type="password" id="password" name="password" οnblur="return checkuser();"/> <span
id="pwdMsg"></span>
</td>
</tr>
<tr>
<td><div align="right">确认密码:</div>
</td>
<td><input type="password" id="wpassword" name="wpassword" οnblur="return checkuser();"/> <span
id="wpwdMsg"></span>
</td>
</tr>
<tr>
<td><div align="right">验证码:</div>
<td><input type="text" id="verify" name="verify" οnblur="return checkuser();"/> <span
id="verMsg"></span></td>
<td><div id="Preview" class="ImgPreview"><script type="text/javascript">document.write("<img id='imgVerify' alt='验证码' οnclick='nChange()' src='${pageContext.request.contextPath }/common/RandVerifyImg.jsp' style='cursor: pointer;'>")</script></div></td>
</tr>
<tr>
<td>
<div align="right">
<input type="checkbox" checked='checked' id="check_id" name="check_id" value="1" οnclick="isaccepted();"/>
</div>
</td>
<td>我已仔细阅读并接受 <a href="#">cm注册条款。</a>
</td>
</tr>
<tr>
<td><div align="right">
<%--提交方法,<s:form表单要记得导入s标签。
<s:form name="form1" method="post" action="edit_mem.action" namespace="/sysadmin" >
<form name="form1" method="post" action="${pageContext.request.contextPath}/sysadmin/edit_mem.action " >
<input type="submit" value="提交" id="sub"/>
<button type="submit" id="sub" οnclick="document.forms[0].submit();">提交 </button>
--%>
<input type="submit" value="提交" id="sub"/>
</div>
</td>
<td><input name="" type="reset" />
</td>
</tr>
</tr>
</table>
</form>
</body>
</html>
基本功不扎实,被表单刺激一整天了。注册页面一天- -!
最新推荐文章于 2019-06-03 16:40:26 发布