【JSP开源代码栏目提醒】:本文主要为网学会员提供addOrModifyApplicantInfo.jsp,希望对需要addOrModifyApplicantInfo.jsp网友有所帮助,学习一下!
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head>
<title>添加(修改)注册信息</title>
<script type="text/javascript">
function DoDiff()
{
var ac = enrollmentForm.event.value;
if (ac == 'modify')
enrollmentForm.event.value = 'savemodify';
if (ac == 'new')
enrollmentForm.event.value = 'savenew';
var sn = document.all['wbApplicantInfo.idCard'].value;
var name = document.all['wbApplicantInfo.name'].value;
var which = document.getElementById("wbApplicantInfo.sex").selectedIndex;
var pw = document.all['wbApplicantInfo.password'].value;
var pw2 = document.all['verifypassword'].value;
var tel = document.getElementById("wbApplicantInfo.telephone").value;
if(sn == null || sn == "")
{
alert("身份证号不能为空!");
return;
}
if (name == null ||name == "")
{
alert("不能为空!");
return;
}
if (pw == null || pw == '')
{
alert("密码不能为空");
return;
}
if (pw != pw2)
{
alert("两次输入的密码不一致!");
ocument.all['wbApplicantInfo.password'].focus();
return ;
}
if (tel == null || tel == "")
{
alert("请输入联系方式!");
return;
}
if (which == 0)
document.getElementById("wbApplicantInfo.sex").value = "男";
else
document.getElementById("wbApplicantInfo.sex").value = "女";
document.enrollmentForm.submit();
}
function returnToHomePage()
{
window.location = "./chooseOperation.jsp";
}
</script>
</head>
<body bgcolor="#c0c0c0">
<html:form action="/enrollmentAction">
<html:hidden property="event"/>
<input type="hidden" name="idCard" value='<bean:write property="wbApplicantInfo.idCard" name="enrollmentForm"/>'/>
<table width="80%" border="0" cellspacing="0" cellpadding="1" >
<tr><td align="right">身份证号</td>
<td><html:text property="wbApplicantInfo.idCard" ></html:text></td>
</tr>
<tr><td align="right"></td>
<td><html:text property="wbApplicantInfo.name"></html:text></td>
</tr>
<tr><td align="right">密码</td>
<td><html:password property="wbApplicantInfo.password"></html:password></td>
</tr>
<tr><td align="right">确认密码</td>
<td><input type="password" name="verifypassword" value=""/></td>
</tr>
<tr><td align="right">性别</td>
<td><html:select property="wbApplicantInfo.sex">
<html:option value="男">男</html:option>
<html:option value="女">女</html:option>
</html:select>
</td>
</tr>
<tr><td align="right">联系电话</td>
<td><html:text property="wbApplicantInfo.telephone"></html:text></td>
</tr>
<tr><td align="right">备注</td>
<td><html:textarea property="wbApplicantInfo.note"></html:textarea></td>
</tr>
<tr><td> </td>
<td><input type="button" value="保 存" class="choosebutton" onclick="DoDiff()"/>
<input type="reset" name="reset" value="取 消"/>
<input type="button" value="回首页" class="choosebutton" onclick="returnToHomePage();"/>
</td>
</tr>
</table>
</html:form>
</body>
</html>