updateUser.jsp
资源名称:(J2EE)oa.rar [点击查看]
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:6k
源码类别:
Jsp/Servlet
开发平台:
Java
- <%@ page language="java" pageEncoding="GBK"%>
- <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
- <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
- <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
- <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
- <html>
- <head>
- <style type="text/css">
- <!--
- .STYLE1 {
- font-family: "新宋体";
- font-size: 14px;
- }
- -->
- </style>
- </head>
- <script>
- function checkform(){
- var uname=document.getElementById("uname");
- if(uname.value.length<=0){
- alert('用户名不能为空!');
- uname.focus();
- return false;
- }
- var utruename=document.getElementById("utruename");
- if(utruename.value.length<=0){
- alert('真实姓名不能为空!');
- utruename.focus();
- return false;
- }
- var uphone = document.getElementById("uphone");
- if(uphone.value != ""){
- //电话号码不是数字的时候,判断
- if(isNaN(uphone.value)){
- //判断第三第四是否为 ‘-’,且只有一个
- if((uphone.value.charAt(3)=='-' || uphone.value.charAt(4)=='-')&(
- (uphone.value.indexOf('-'))==(uphone.value.lastIndexOf('-')))){
- var phonepart = uphone.value.split('-');
- //判断被 '-' 分成的两部分是否都为数字
- if(isNaN(phonepart[0]) || isNaN(phonepart[1])){
- alert('电话号码格式不正确!');
- return false;
- }
- else{
- //判断后面部门是否是7或8位数字
- if(!(phonepart[1].length==7 || phonepart[1].length==8)){
- alert('电话号码长度不对!');
- return false;
- }
- }
- }
- else{
- alert('电话号码格式不正确!');
- return false;
- }
- }//电话号码是数字的时候,判断
- else{
- alert('电话号码格式不正确!');
- return false;
- }
- }else{
- alert('电话号码不能为空!');
- return false;
- }
- var email = document.getElementById("uemail").value;
- if(email != ""){
- //判断第一个字符不能为@和.
- if((email.charAt(0) =='@') || (email.charAt(0) == '.')){
- alert('邮箱格式不对!例:zpeng_chen@126.com');
- return false;
- }else{
- //判断.与@之间是否有间隔
- if((email.indexOf('.'))-(email.indexOf('@'))<=1){
- alert('邮箱格式错误!');
- return false;
- }else{
- //判断是否只有一个@ 和 只有一个 .
- if(email.indexOf('@') != email.lastIndexOf('@') || email.indexOf('.') != email.lastIndexOf('.')){
- alert('邮箱格式错误!');
- return false;
- }else{
- //判断.后不能为空
- var emailPart = email.split('.');
- if(email.length-emailPart[0].length < 2){
- alert('邮箱格式错误!');
- return false;
- }else{
- //动作
- }
- }
- }
- }
- }else{
- alert('邮箱不能为空!');
- return false;
- }
- }
- function isNumber(){
- if (window.event.keyCode<48 || window.event.keyCode>57){
- window.event.keyCode = 0;
- }
- }
- </script>
- ${msg}
- <body>
- <html:form action="/user">
- <html:hidden property="method"/>
- <html:hidden property="uno"/>
- <html:hidden property="uislocked"/>
- <html:hidden property="upwd"/>
- <html:hidden property="uisonline"/>
- <html:hidden property="uaddtime"/>
- <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#66CCFF" class="STYLE1">
- <tr class="tableHead" style="font-size: 20px">
- <td height="46" colspan="2" align="center"><STRONG>修改个人信息</STRONG></td>
- </tr>
- <tr>
- <td width="120"><div align="right" >用户名:</div></td>
- <td><html:text property="uname" style=" width:100px" maxlength="15"/><html:errors property="uname"/>
- <font color="#FF0000">*</font></td>
- <td></td>
- </tr>
- <tr>
- <td width="120"><div align="right">真实姓名:</div></td>
- <td>
- <html:text property="utruename" style=" width:100px" maxlength="15"/>
- <font color="#FF0000">*</font></td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">所属部门:</div></td>
- <td>
- <html:select property="did">
- <html:option value="">请选择</html:option>
- <logic:present name="deptlist" scope="request">
- <logic:iterate id="dept" scope="request" name="deptlist">
- <html:option value="${dept.did}">${dept.dname}</html:option>
- </logic:iterate>
- </logic:present>
- </html:select>
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">性别:</div></td>
- <td>
- <html:radio property="usex" value="1"/>男
- <html:radio property="usex" value="0" />女
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">籍贯:</div></td>
- <td>
- <html:text size="15" property="uarea"/> 如:福建福州
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">联系电话:</div></td>
- <td>
- <html:text property="uphone" maxlength="13" size="20"/> 由区号-电话号码组成,如:0591-12341234
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">E_MAIL:</div></td>
- <td>
- <html:text property="uemail" maxlength="30" size="30"/> 如:fz163@163.com
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">手机号码:</div></td>
- <td>
- <html:text onkeypress="isNumber()" property="umobile" maxlength="11" size="16"/>
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">住址:</div></td>
- <td>
- <html:text property="uaddress" size="80"/>
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">工作职位:</div></td>
- <td>
- <html:select property="uwork">
- <html:option value="">请选择</html:option>
- <logic:present name="worklist" scope="request">
- <logic:iterate id="work" scope="request" name="worklist">
- <html:option value="${work.pid}">${work.pname}</html:option>
- </logic:iterate>
- </logic:present>
- </html:select>
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">是否已婚:</div></td>
- <td>
- <html:radio property="uismarryed" value="1" />已婚
- <html:radio property="uismarryed" value="0" />未婚
- </td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">身份证号码:</div></td>
- <td><html:text onkeypress="isNumber()" property="uidcard" maxlength="18"/></td>
- <td></td>
- </tr>
- <tr>
- <td><div align="right">备注:</div></td>
- <td>
- <html:textarea property="umemo" cols="50" rows="5"/>
- </td>
- <td></td>
- </tr>
- <tr align="center">
- <td colspan="2">
- <html:submit value="提交" />
- <html:reset value="重置" />
- </td>
- <td></td>
- </tr>
- </table>
- </html:form>
- </body>
- </html>