register_1.jsp
来自「用JSP写的一个在线购物网站的代码」· JSP 代码 · 共 361 行 · 第 1/2 页
JSP
361 行
<%@ page contentType="text/html;charset=gb2312" import="java.sql.*,java.util.*,shop.buy.buy" %>
<jsp:useBean id="data" scope="page" class="shop.data.conn" />
<style type="text/css">
<!-- @import url(images/css.css); -->
</style>
<script language="JavaScript">
function checkreg()
{
if(document.reg.name.value.length==0)
{
alert("请填写用户名");
document.reg.name.focus();
return false;
}
if(document.reg.pwd.value.length<6 || document.reg.pwd.value.length>10)
{
alert("请填写您的密码,并检查位数是否在6和10之间");
document.reg.pwd.focus();
return false;
}
if(document.reg.pwd.value!=document.reg.repwd.value)
{
alert("请检查您两次输入的密码是否相同");
document.reg.repwd.focus();
return false;
}
if(document.reg.pwdquery.value=="no")
{
alert("请选择您的密码提示问题,\n以便于将来密码遗失后找回密码");
document.reg.pwdquery.focus();
return false;
}
if(document.reg.pwdanswer.value.length<3)
{
alert("请填写您的密码提示答案,并且不能小于6个字符");
document.reg.pwdanswer.focus();
return false;
}
if(document.reg.email.value.length==0)
{
alert("请填写您的电子邮件,以便我们与您联系");
document.reg.email.focus();
return false;
}
if(document.reg.email.value.indexOf("@")== -1)
{
alert("请检查您的email格式是否正确");
document.reg.email.focus();
return false;
}
if(document.reg.realname.value.length==0)
{
alert("请填写您的真实姓名");
document.reg.realname.focus();
return false;
}
if(document.reg.rate.value=="no")
{
alert("请选择您要申请的会员级别 ");
document.reg.rate.focus();
return false;
}
if(document.reg.mode.value=="no")
{
alert("请选择您的交易方式");
document.reg.mode.focus();
return false;
}
if(document.reg.zone.value.length==0)
{
alert("请填写电话区号");
document.reg.zone.focus();
return false;
}
if(document.reg.phone.value.length==0)
{
alert("请填写联系电话");
document.reg.phone.focus();
return false;
}
if(document.reg.address.value.length==0)
{
alert("请填写你的家庭住址,以便于我们能给准确的给你发货");
document.reg.address.focus();
return false;
}
if(document.reg.IDcard.value.length==0)
{
alert("请填写您的身份证号码");
document.reg.IDcard.focus();
return false;
}
if(document.reg.IDcard.value.length!=15 && document.reg.IDcard.value.length!=18)
{
alert("请检查您的身份证号码是否准确");
document.reg.IDcard.focus();
return false;
}
if(document.reg.zipcode.value.length==0)
{
alert("请填写您的邮政编码");
document.reg.zipcode.focus();
return false;
}
}
function check_id()
{
var username=document.reg.name.value;
window.open("namechk.jsp?name="+username,"body","width=180,height=80");
}
</script>
<body bgcolor="#63bce6" leftmargin="0" topmargin="0">
<table border=0 cellPadding=0 cellSpacing=0 width=770>
<tr height=7 background="images/main_top_line.gif">
<td colSpan=3 height=7></td>
</tr>
<tr>
<td background="images/main_left_line.gif" width=7></TD>
<td vAlign=top> <table width="756" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="95" valign="middle"><%@ include file="top.jsp"%></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="165"><%@ include file="left.jsp" %></td>
<td width="14"></td>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="560" height="25"><div align="right" class="darkbluetext">HOME
> <font color="#FF0000">会员注册</font></div></td>
<td> </td>
</tr>
<tr>
<td colspan="2"><table width="560" border="0" cellspacing="0" cellpadding="0">
<form name="reg" method="post" action="regok.jsp" onsubmit="return checkreg()">
<tr class="defaulttext" height="10">
<td height="10"></td>
</tr>
<tr>
<td><img src="images/regup.gif" width="560" height="35"></td>
</tr>
<tr height="10">
<td height="10"></td>
</tr>
<tr>
<td><img src="images/regmem.gif" width="560" height="40"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="p"><img src="images/id.gif" width="69" height="16"></td>
</tr>
<tr height="10">
<td height="10"></td>
</tr>
<tr>
<td><table width="560" border="0" cellpadding="0" cellspacing="1" bgcolor="#E6E6E6">
<tr>
<td valign="top" bgcolor="#FFFFFF"><table width="558" border="0" cellpadding="2" cellspacing="3" bgcolor="#F5F5F3">
<tr>
<td valign="top" bgcolor="#FFFFFF"><table width="548" border="0" cellspacing="0" cellpadding="0">
<tr class="defaulttext">
<td width="130" height="30" bgcolor="#F5F5F5" class="p"><strong><font color="#006ED5">•</font>
用户名</strong></td>
<td width="402" class="p"><input type="text" name="name" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva" size="20">
<a href="javascript:check_id()"><img src="images/checkid.gif" width="60" height="19" border="0" align="absmiddle"></a>
</td>
</tr>
<tr class="defaulttext">
<td height="30" bgcolor="#F5F5F5" class="p"><strong><font color="#006ED5">•</font>
密 码</strong></td>
<td class="p"><input type="password" name="pwd" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva" size="20"></td>
</tr>
<tr class="defaulttext">
<td height="30" bgcolor="#F5F5F5" class="p"><strong><font color="#006ED5">•</font>
重复密码</strong></td>
<td class="p"><input type="password" name="repwd" style="background-color:#ECECEC; border-style:1; font-size: 11; color: #000000; font-family: arial, verdana, geneva" size="20">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?