Address_Create.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:6k
源码类别:

电子政务应用

开发平台:

Java

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  4. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  5. <script language="JavaScript" src="/vnex/validate.js" ></script>
  6. <script language="JavaScript">
  7. function isDigit (c)
  8. {   
  9.   return ((c >= "0") && (c <= "9"))
  10. }
  11. function isInteger (s)
  12. {   
  13.     var i;
  14.     for (i = 0; i < s.length; i++)
  15.     {
  16.         var c = s.charAt(i);
  17.         if (!isDigit(c)) return false;
  18.     }
  19.     return true;
  20. }
  21. function isValidChar(str)
  22. {
  23.   var i,j,strTemp;
  24.   strTemp="<>/\";
  25.   for (i=0;i<str.length;i++)
  26.   {
  27.     j=strTemp.indexOf(str.charAt(i));
  28.     if (j!=-1)
  29.     {
  30.       return false;
  31.     }
  32.   }
  33.   return true;
  34. }
  35. function check()
  36. {
  37.   if (!stripWhitespace(document.myform.companyName.value) || document.myform.companyName.value=="" || document.myform.companyName.value.length>50)
  38. {
  39.   alert("公司名不能为空,并且少于50个字。");
  40.   document.myform.companyName.focus();
  41.   return false;
  42. }
  43. if (document.myform.companyAddress.value.length>50)
  44. {
  45.   alert("公司地址应少于50个字。");
  46.   document.myform.companyAddress.focus();
  47.   return false;
  48. }
  49. if ((!document.myform.companyZip.value=="" && document.myform.companyZip.value.length!=6) || !isInteger(document.myform.companyZip.value))
  50. {
  51.   alert("公司邮编应该是6位数字。");
  52.   document.myform.companyZip.focus();
  53.   return false;
  54. }
  55. if (document.myform.companyTelephone.value.length>20)
  56. {
  57.   alert("公司电话应少于20个字。");
  58.   document.myform.companyTelephone.focus();
  59.   return false;
  60. }
  61. if (document.myform.companyFax.value.length>20)
  62. {
  63.   alert("公司传真应少于20个字。");
  64.   document.myform.companyFax.focus();
  65.   return false;
  66. }
  67.   if(!isValidChar(myform.companyName.value) || !isValidChar(myform.companyAddress.value) || !isValidChar(myform.companyTelephone.value) 
  68.      || !isValidChar(myform.companyFax.value))
  69.   {
  70.     alert("输入内容不能包括 < > / \ 这些特殊字符。");
  71.     return false;
  72.   }
  73.   else
  74.     return true;
  75. }
  76. function createCompany()
  77. {
  78.  if( !check() )
  79.  {
  80.    return false;
  81.  }
  82.  myform.action= "/mainctrl/commoninfo/addresslist/createAddressListSuccess";
  83.   myform.submit();
  84. }
  85. </script>
  86. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  87. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  88. <DIV align=center>
  89.   <form name="myform" method="post" action="">
  90.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  91.     <TBODY> 
  92.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  93.     <TR> 
  94.         <TD colSpan=3 align="center"><br>
  95.           <!--个人信息开始 -->
  96.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  97.             <tr bgcolor="#fafafa">
  98.               <td> 
  99.                 <table width="600" border="0" cellspacing="1" cellpadding="2" class="title">
  100.                   <tr bgcolor="#666666"> 
  101.                     <td colspan="2"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>&gt;&gt;<a href="/mainctrl/commoninfo/addresslist/getAddressList"><font color="#FFFFFF">外部通讯录</font></a>&gt;&gt;添加公司通讯录</font></td>
  102.                   </tr>
  103.                   <tr bgcolor="#e0e0e0"> 
  104.                     <td width="17%"> 
  105.                       <font class="strong">&nbsp;公司名称:</font>
  106.                     </td>
  107.                     <td width="83%"> 
  108.                       <input type="text" name="companyName" class="file" size="24">&nbsp;*&nbsp;(注:带*为必填内容)
  109.                     </td>
  110.                   </tr>
  111.                   <tr bgcolor="#fafafa"> 
  112.                     <td width="17%"> 
  113.                       <font class="strong">&nbsp;地址:</font><br>
  114.                     </td>
  115.                     <td width="83%">
  116.                       <input type="text" name="companyAddress" class="file" size="72">
  117.                     </td>
  118.                   </tr>
  119.                   <tr bgcolor="#e0e0e0"> 
  120.                     <td width="17%"> 
  121.                       <font class="strong">&nbsp;邮编:</font>
  122.                     </td>
  123.                     <td width="83%">
  124.                       <input type="text" name="companyZip" class="file" size="6">
  125.                     </td>
  126.                   </tr>
  127.                   <tr bgcolor="#fafafa"> 
  128.                     <td width="17%"> 
  129.                       <font  class="strong">&nbsp;电话:</font>
  130.                     </td>
  131.                     <td width="83%">
  132.                       <input type="text" name="companyTelephone" class="file" size="24">
  133.                     </td>
  134.                   </tr>
  135.                   <tr bgcolor="#e0e0e0"> 
  136.                     <td width="17%"> 
  137.                       <font  class="strong">&nbsp;传真:</font>
  138.                     </td>
  139.                     <td width="83%"> 
  140.                       <input type="text" name="companyFax" class="file" size="24">
  141.                     </td>
  142.                   </tr>
  143.                   <tr bgcolor="#fafafa"> 
  144.                     <td colspan="2" height="30"> 
  145.                       <div align="center"> 
  146.                         <input type="button" name="Submit" value="保存" class="text" onClick="return createCompany()">
  147.                         &nbsp;&nbsp;<input type="reset" name="Submit3" value="重置" class="text" >
  148.                         &nbsp;&nbsp;<input type="button" name="Submit2" value="放弃" class="text" onClick="history.back()">
  149.                       </div>
  150.                     </td>
  151.                   </tr>
  152.                 </table>
  153.               </td>
  154.             </tr>
  155.           </table>
  156.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  157.        </TD>
  158.     </TR>
  159.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  160.     </TBODY> 
  161.   </TABLE>
  162.   <BR>
  163.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  164. </form></DIV>
  165. </BODY></HTML>