<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="gbase.db.*,gbase.util.*,java.sql.*" %>
<HTML>
<HEAD>
<TITLE>会员注册</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="css/gdtel.css" type=text/css rel=stylesheet>
<LINK href="css/other.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="js/md5.js"></script>
<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>
<BODY>
<%String web_account= request.getParameter("web_account")==null?"":request.getParameter("web_account");%>
<FORM name="form" action="member_register_save.jsp" method=post target="_top">
  <input name="web_account" type="hidden" value="<%=web_account%>">
  <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
     <TBODY>
        <TR>
            <TD width="80" height=25>用户名：</TD>
            <TD><INPUT type="text" name="username" size=25 maxlength="20">&nbsp;<font color="red">*</font>
        </TR>
        <TR>
            <TD height=25>密码：</TD>
            <TD><INPUT type="password" name="password" size=25 maxlength="20">&nbsp;<font color="red">*</font></TD>
        </TR>
        <TR>
            <TD height=25>确认密码：</TD>
            <TD><INPUT type="password" name="confirmPassword" size=25 maxlength="20">&nbsp;<font color="red">*</font></TD>
        </TR>
        <TR>
            <TD width="80" height=25>姓名：</TD>
            <TD><INPUT type="text" name="name" size=35 maxlength="50">&nbsp;<font color="red">*</font></TD>
        </TR>
        <TR>
            <TD  height=25>Email：</TD>
            <TD><INPUT type="text" name="email" size=35 maxlength="50">&nbsp;<font color="red">*</font></TD>
        </TR>
        <TR>
           <TD align=middle colSpan=2 height=50>
           <INPUT onClick="javascript:if(check_validate(this.form)){this.form.submit();}" type=button value=注册会员 name=save> 
           &nbsp;&nbsp;&nbsp; 
           <INPUT type=reset value="重  写" name=Submit2>
           </TD>
        </TR>
     </TBODY>
  </TABLE>
</FORM>
<Script Language="javaScript">
function isSpace(str) {
      var len = str.length;
      for(var i=0; i< len; i++) {
        temp = str.substring(i,i+1);
        if (temp != " ") {
            return false;
        }
      }
      return true;
    }
//校验用户姓名：只能输入1-25个以字母开头的字串 
function isTrueName(s) 
{       
	var patrn=/^[a-zA-Z0-9_-]{1,25}$/; 
	if (!patrn.exec(s)) return false 
	return true 
} 
function  check_validate(theForm) {
        if (isSpace(theForm.username.value)) {
            alert("用户名不能为空！");
            theForm.username.focus();
            return false;
        }
        if (theForm.username.value.length<5) {
            alert("用户名字符数不能少于5个！");
            theForm.username.focus();
            return false;
        }
        if(isTrueName(theForm.username.value) == false) {
		alert("用户名错误，用户名\n\n只能由字母a-z,数字0-9\n\n下划线_ 和 连接符号- 组成\n\n请修改用户名");
		theForm.username.focus();
		return(false);
	}
        if (isSpace(theForm.password.value)) {
            alert("密码不能为空！");
            theForm.password.focus();
            return false;
        }
        if (isSpace(theForm.confirmPassword.value)) {
            alert("确认密码不能为空！");
            theForm.confirmPassword.focus();
            return false;
        }
        if (theForm.password.value!=theForm.confirmPassword.value) {
            alert("密码与确认密码不相等，请重新输入！");
            theForm.password.focus();
            return false;
        }
        if (isSpace(theForm.name.value)) {
            alert("姓名不能为空！");
            theForm.name.focus();
            return false;
        }
        if (isSpace(theForm.email.value)) {
            alert("Email不能为空！");
            theForm.email.focus();
            return false;
        }
        return true;
      }
</Script>
</BODY></HTML>