<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'register.jsp' starting page</title>
    
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<LINK href="images/register.css" type=text/css rel=stylesheet>
<script type="text/javascript">
     function check(){
        var name=document.getElementById("item.name").value;
        var password=document.getElementsByName("item.password")[0].value;
        var pwd=document.getElementsByName("item.password")[1].value;
        var email=document.getElementById("item.email").value;
        var vcode=document.getElementById("item.vcode").value;
        if(name==null||name==""){
            document.getElementById("errorName").innerHTML="用户名不能为空!";
            return false;
        }
        if(password==null||password==""){
            document.getElementById("errorPassword").innerHTML="密码不能为空!";
            return false;
        }
        if(pwd==null||pwd==""){
        document.getElementById("errorPwd").innerHTML="确认密码不能为空!";
        return false;
        }
        if(pwd!=password){
        document.getElementById("errorPwd").innerHTML+="两次输入的密码不相等!";
        return false;
        }
        if(email==null||email==""){
           document.getElementById("errorEmail").innerHTML+="邮箱不能为空!";
           return false;
        }
        if(vcode==null||vcode==""){
           document.getElementById("errorVcode").innerHTML+="验证码不能为空! ";
           return false;
        }
        return true;
     }
</script>
  </head>
  
  <body>
    <div class="loginform" >
<html:form action="/user/add.do" method="get">
<html:hidden property="operate" value="doAddUserInfo"/>
<table width="325" border="0">
  <tr>
    <td width="88" ><em><br>用户名:</em></td>
    <td  >
    <html:text property="item.name"  maxlength="50" size="15"  ></html:text><font id="errorName"  style="color:red">*</font></td>
  </tr>
  <tr>
    <td><em>密码:</em></td>
    <td ><html:password property="item.password"  size="15" maxlength="50"></html:password><font id="errorPassword"  style="color:red">*</font></td>
  </tr>
  <tr>
    <td><em>确认密码:</em></td>
    <td><html:password property="item.password"   size="15" maxlength="50"></html:password><font id="errorPwd"  style="color:red">*</font></td>
  </tr>
  <tr>
    <td><em>邮箱:</em></td>
    <td><html:text property="item.email"  size="15" maxlength="50"></html:text><font id="errorEmail"  style="color:red">*</font></td>
  </tr>
  <tr>
    <td><em>验证码:</em></td>
    <td><html:text property=""  value="验证码" style="width:50px" size="8"></html:text>&nbsp;&nbsp;<img src="vcode.jsp" /><html:errors property="errorVcode"/><font id="errorVcode"  style="color:red">*</font></td>
  </tr>
  <tr>
     <td  colspan="2" align="center"><input name="" type="submit" onClick="return check();" value="注 册"  /> &nbsp;&nbsp;&nbsp;<input name="" value="重 置" type="reset" /></td>
  </tr>
</table>
</html:form></div>
  </body>
</html>