⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regadmin.jsp

📁 电子商城
💻 JSP
字号:
<%@ page language="java" contentType="text/html;charset=GBK" %>
<html>
	<head>	
	<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
	<meta http-equiv="expires" content="Wed, 26 Feb 1970 08:21:57 GMT" />

		<script language="javascript" type="text/javascript" src="/lmhshop/font/calendar.js"></script>
		
		<link rel="stylesheet" href="main.txt" type="text/css" >
		
		<script language="javascript" type="text/javascript">
		
			function checkSuser(){
				var userValue=regform.suser.value;
				var userObj=window.document.getElementById("userSpan");
				if(userValue.length==0){
					userObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />用户名不能为空";
					return false;
				}else if(userValue.length<3){
					userObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />用户名长度不能小于3位!";
					return false;
				}else if(userValue.replace(/[a-zA-Z0-9]/g,"").length!=0){
					userObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />用户名必须是英文字母或数字!";
					return false;
				}
				userObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			
			function checkPwd(){
				var pwdValue=regform.spwd.value;
				var pwdObj=window.document.getElementById("pwdSpan");
				
				if(pwdValue.length<3){
					pwdObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />密码长度不能小于3位!";
					return false;
				}
				pwdObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			function checkNewpwd(){
				var pwdV1=regform.spwd.value;
				var pwdV2=regform.newpwd.value;
				
				var newPObj=window.document.getElementById("newPSpan");
				if(pwdV2.length==0){
					newPObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />确认密码不能为空!";
					return false;
				}else if(pwdV1!=pwdV2){
					newPObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />确认密码与原密码不匹配!";
					return false;
				}
				newPObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			
			function checkRealName(){
				var realName=regform.sname.value;
				var nameObj=window.document.getElementById("realSpan");
				
				if(realName.length==0){
					nameObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' /> 真实姓名不能为空!";
					return false;
				}else if(realName.length>15){
					nameObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' /> 真实姓名长度不能大于15 !";
					return false;
				}
				nameObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			
			function checkBirth(){
				var birthValue=regform.sbirth.value;
				var birthObj=window.document.getElementById("birthSpan");
				if(birthValue.replace(/\s/g,"").length==0){
					birthObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' /> 出生日期不能为空!";
					return false;
				}
				birthObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			
			function checkCode(){
				var codeValue=regform.scode.value;
				var codeObj=window.document.getElementById("codeSpan");
				if(codeValue.replace(/[0-9]/g,"").length!=0){
					codeObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />邮编必须是数字组成!";
					return false;
				}else if(codeValue.length!=6){
					codeObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />邮编必须是6位数字组成!";
					return false;
				}
				codeObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			
			function checkAdd(){
				var addValue=regform.saddress.value;
				var addObj=window.document.getElementById("addSpan");
				if(addValue.length>100){
					addObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />地址长度不能大于100 !";
					return false;
				}else if(addValue.length==0){
					addObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />地址不能为空!";
					return false;
				}
				addObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			
			function checkEmail(){
			
				var emailValue=regform.semail.value;
				var emailObj=window.document.getElementById("emailSpan");
				if(emailValue.replace(/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/g,"").length!=0){
					emailObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />邮箱格式不正确!";
					return false;
				}else if(emailValue.length==0){
					emailObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />邮箱不能为空!";
					return false;
				}
				emailObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			function checkPhone(){
			
				var phoneValue=regform.sphone.value;
				var phoneObj=window.document.getElementById("phoneSpan");
				if(phoneValue.replace(/(\d{3}-\d{8}|\d{4}-\d{8}|\d{4}-\d{7}|\d{3}-\d{7})(-\d{2,8})?/g,"").length!=0){
					phoneObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />电话号码格式不正确,区号和号码之间用'-'隔开!";
					return false;
				}else if(phoneValue.length==0){
					phoneObj.innerHTML="<img src='/lmhshop/image/cc_error.gif' />电话号码不能为空!";
					return false;
				}
				phoneObj.innerHTML="<img src='/lmhshop/image/cc_right.gif' />";
				return true;
			}
			function checkSubmitForm(){
				return checkSuser()&&checkPwd()&&checkNewpwd()&&checkRealName()&&checkBirth()&&checkAdd()&&checkCode()&&checkEmail()&&checkPhone();
			}
			function checkForm(){
				regform.reset();
				return checkSuser()&&checkPwd()&&checkNewpwd()&&checkRealName()&&checkBirth()&&checkAdd()&&checkCode()&&checkEmail()&&checkPhone();
			}
		</script>
	</head>
	<body>
		
		<table width="100%" border="1">
          <tr>
            <td><center>
              <b>添加管理员</b><br>
              <form name="regform" id="regform" method="post"  action="/lmhshop/servlet/AddAdminServlet" onSubmit="return checkSubmitForm();" >
                <table width="60%" border="1">
                  <tr>
                    <td width="22%" align="right">&nbsp;用 户 名:</td>
                    <td colspan="2"><input class="text" type="text" name="suser" maxlength="30" onBlur="checkSuser();" />
                    <span id="userSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">密&nbsp;&nbsp;码:</td>
                    <td colspan="2"><input class="text"type="password" name="spwd" onBlur="checkPwd();"/>
                        <span id="pwdSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">确认密码:</td>
                    <td colspan="2"><input class="text" type="password" name="newpwd" onBlur="checkNewpwd();"/>
                        <span id="newPSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">性 &nbsp; 别:</td>
                    <td colspan="2"><input type="radio" name="ssex" value="男" checked/>
                        <input type="radio" name="ssex" value="女"  />
                      女&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">真实姓名:</td>
                    <td colspan="2"><input class="text" type="text" name="sname" onBlur="checkRealName();"/>
                        <span id="realSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">出生日期:</td>
                    <td colspan="2"><input class="text" type="text" name="sbirth"  onfocus="javascript:{show_cele_date(this,'','',this);}"/>
                        <span id="birthSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">电子邮箱:</td>
                    <td colspan="2"><input class="text" type="text" name="semail" onBlur="checkEmail();"/>
                        <span id="emailSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">电话号码:</td>
                    <td colspan="2"><input class="text" type="text" name="sphone" onBlur="checkPhone();"/>
                        <span id="phoneSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">地&nbsp;&nbsp;址:</td>
                    <td colspan="2"><input class="text" type="text" name="saddress" onBlur="checkAdd();"/>
                        <span id="addSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right">邮&nbsp;&nbsp;编:</td>
                    <td colspan="2"><input class="text" type="text" name="scode" onBlur="checkCode();"/>
                        <span id="codeSpan"></span>&nbsp;&nbsp;</td>
                  </tr>
                  <tr align="center">
                    <td colspan="2"><input name="addAdimUser" id="addAdimUser" type="submit"  value="提交" />
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input name="resetInfo" type="button" id="resetInfo" value="重置" onClick="checkForm();" /></td>
                  </tr>
                </table>
              </form>
            </center></td>
          </tr>
        </table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -