exterior.jsp
资源名称:(J2EE)oa.rar [点击查看]
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:6k
源码类别:
Jsp/Servlet
开发平台:
Java
- <%@ page language="java" import="java.util.*" 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"%>
- <%@ page import="java.util.Date"%>
- <%@ page import="java.util.ArrayList"%>
- <%@ page import="java.util.List"%>
- <%@ page import="java.util.Date"%>
- <html>
- <head>
- <script>
- function checkform(){
- var eunit1=document.ectomereForm.eunit;
- if(eunit1.value.length<=0){
- alert('单位名称不能为空');
- eunit1.focus();
- return false;
- }
- var etype1=document.ectomereForm.etype;
- if(etype1.value.length<=0){
- alert('企业类别不能为空');
- etype1.focus();
- return false;
- }
- var eaddress1=document.ectomereForm.eaddress;
- if(eaddress1.value.length<=0){
- alert('单位名称不能为空');
- eaddress1.focus();
- return false;
- }
- var ephone1=document.ectomereForm.ephone;
- if(ephone1.value!=""){
- //电话号码不是数字的时候,判断
- if(isNumber(ephone1.value)){
- //判断第三第四是否为'-',且只有一个
- if((ephone1.value.charAt(3)=='-'||ephone1.value.charAt(4)=='-')&((
- ephone1.value.indexOf('-'))==(ephone1.value.lastIndexOf('-')))){
- var ephonepart=ephone1.value.split('-');
- //判断被'-'分成的两部分是否都为数学
- if(isNumber(ephonepart[0])||isNumber(ephonepart[1])){
- alert('电话号码格式不正确!');
- ephone1.focus();
- return false;
- }else{
- //判断后面部分是否为7位8位数字
- if(!(ephonepart[1].length==7||ephonepart[1].length==8)){
- alert('电话号码格式不正确!');
- ephone1.focus();
- return false;
- }
- }
- }else{
- alert('电话号码格式不正确!');
- ephone1.focus();
- return false;
- }
- }
- }
- }else{
- alert('电话号码不能为空!');
- return false;
- }
- var eemail1=document.ectomereForm.eemail;
- if(eemail1.value!=""){
- //判断第一个字符不能为@和.
- if((eemail1.charAt(0)=='@')||(eemail1.charAt(0)=='.')){
- alert('邮箱格式不对!');
- eemail1.focus();
- return false;
- }else{
- //判断.与@之间是否有间隔
- if((eemail1.indexOf('.'))-(eemail1.indexOf('@'))<=1){
- alert('邮箱格式错误!');
- eemail1.focus();
- return false;
- }else{
- //判断是否只有一个@和只有一个.
- if(eeamil1.indexOf('@')!=eemail1.lastIndexOf('@')||eemail1.indexOf('.')!=eemail1.lastIndexOf('.')){
- alert('邮箱格式错误!');
- eemail1.focus();
- return false;
- }else{
- //判断.后不能为空
- var eemailPart=eemail1.split('.');
- if(eemail1.length-eemailPart[0].length<2){
- alert('邮箱格式错误!');
- eemail1.focus();
- return false;
- }
- }
- }
- }
- }
- var elinkman1=document.ectomereForm.elinkman;
- if(elinkman1.value.length<=0){
- alert('联系人不能为空');
- elinkman1.focus();
- return false;
- }
- }
- function isNumber(){
- if (window.event.keyCode<48 || window.event.keyCode>57){
- window.event.keyCode = 0;
- }else{
- alert('该项只能填数字!');
- }
- }
- </script>
- <style type="text/css">
- <!--
- .STYLE2 {color: #FF0000}
- -->
- </style>
- </head>
- <body>
- ${msg}
- <html:form action="/ectomere">
- <html:hidden property="eid" />
- <html:hidden property="task" />
- <table width=100% border="3" cellpadding="2" cellspacing="2" bordercolor="bordercolor=" #3399FF" bgcolor="#99CCFF"">
- <tr>
- <td colspan=2 align="center"><span class="STYLE2">*标记为必填项</span></td>
- </tr>
- <tr>
- <td align="right">
- 单位名称:
- </td>
- <td align="left">
- <html:text property="eunit" maxlength="50"/><span class="STYLE2">*</span>
- </td>
- </tr>
- <tr>
- <td align="right">
- 企业类别:
- </td>
- <td align="left">
- <html:select property="etype">
- <html:option value="">请选择</html:option>
- <logic:present scope="request" name="paramlist">
- <logic:iterate id="param1" name="paramlist" scope="request">
- <html:option value="${param1.pid}">${param1.pname}</html:option>
- </logic:iterate>
- </logic:present>
- </html:select>
- </td>
- </tr>
- <tr>
- <td align="right">
- 联系地址:
- </td>
- <td align="left">
- <html:text property="eaddress" maxlength="50"/><span class="STYLE2">*</span>
- </td>
- </tr>
- <tr>
- <td align="right">
- 联系电话:
- </td>
- <td align="left">
- <html:text property="ephone" maxlength="20"/><span class="STYLE2">*{例:123-1234567或1234-12345678}</span>
- </td>
- </tr>
- <tr>
- <td align="right">
- 电子邮箱:
- </td>
- <td align="left">
- <html:text property="eemail" maxlength="30"/><span class="STYLE2">{例:163@163.com}</span>
- </td>
- </tr>
- <tr>
- <td align="right">
- 联系人:
- </td>
- <td align="left">
- <html:text property="elinkman" maxlength="20" /><span class="STYLE2">*</span>
- </td>
- </tr>
- <tr>
- <td align="right">
- 备注:
- </td>
- <td align="left">
- <html:textarea property="ememo" rows="3" cols="40"></html:textarea>
- </td>
- </tr>
- <tr>
- <td align="right">
- 录入时间:
- </td>
- <TD align="left">
- <input type="text" readonly="readonly" name="eaddtime" value="${eaddtime}">
- </TD>
- </tr>
- <tr>
- <td align="right">
- 录入人:
- </td>
- <td align="left">
- <input type="text" readonly="readonly" name="uno" value="${uno}">
- </td>
- </tr>
- <tr>
- <td colspan=2 align="center">
- <logic:equal value="save" name="ectomereForm" property="task">
- <input type="submit" value="添加" onclick="return checkform();">
- </logic:equal>
- <logic:equal value="edit" name="ectomereForm" property="task">
- <input type="submit" value="修改" onclick="return checkform();">
- </logic:equal>
- </td>
- </tr>
- </table>
- </html:form>
- </body>
- </html>