您的位置:首页 > Web前端 > JavaScript

jsp-注册页面

2018-03-09 15:47 183 查看
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
//验证注册表单
function checkForm(){

var username=document.getElementById("username").value;
if(username==null||username==""){
alert("用户名不能为空");
return false;

}
//为其他字段添加非空校验
var password=document.getElementById("password").value;
var repassword=document.getElementById("repassword").value;
if(password!=repassword )
{
alert("两次密码必须一致");
return false;
}
}

</script>

</head>
<body>
<h1>Estore商城用户注册</h1>
<!-- 一次性验证码 -->
<form action="${pageContext.request.contextPath}/regist" method="post" onsubmit="return checkForm();">
<table>
  <tr>
     <td>用户名</td>
     <td><input type="text" name="username" id="username"/></td>
  </tr>
  <tr>
     <td>密码</td>
      <td><input type="password" name="password" id="password"/></td>
  </tr>
  <tr>
     <td>确认密码</td>
      <td><input type="password" name="repassword" id="repassword"/></td>
  </tr>
  
     <tr>
      <td>昵称</td>
      <td><input type="text" name="nickname"/></td>
     </tr>
     
     <tr>
      <td>邮箱</td>
      <td><input type="text" name="email"/></td>
     </tr>
     <tr>
      <td>验证码</td>
      <td><input type="text" name="checkcode"/><img sr
8eb3
c="/checkcode"></td>
     </tr>
     
     <tr>
      
      <td><input type="submit" value="注册"/></td>
      <td> 
        <!--登录 链接登录页面 ,返回 返回之前页面  -->
      <input type="button" value="返回" onclick="histpry.go(-1)"/>
     
      </td>
     </tr>
     
     
  </table>
  </form>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: