当前位置:文档之家› JAVAWEB系统登陆注册界面关键代码

JAVAWEB系统登陆注册界面关键代码

1、制作企业信息管理系统的登陆页面 2.制作企业信息管理系统的注册页面 3.使用 JavaScript 完成登陆页面和注册页面的验证功能,具体要求如下:
1)登录页面验证用户名、密码不能为空。 2)注册页面验证:
用户名只能由数字和字母组成 密码只能由数字或字母组成,长度为 6~12 位,两次密码必须相同 邮箱、电话、邮编格式必须正确 4.在各个文本框之后(提示关键词:innerHTML)或者使用小窗口(提示关键词:alert) 弹出相应的错误信息
<tr><td width="120" height="1"><li>通讯管理</li></td></tr>
<tr><td width="120" height="1" ><ul><li>通讯录管理</li></ul></td>></tr>
<tr><td width="120" height="1"><ul><li>短消息管理</li></ul></td></tr>
欢迎(首页)界面: <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort
/*用户名只能由数字或字母组成*/ function User(){
var value = document.getElementById("user").value; var curretuser = /^[A-Za-z0-9]+$/; if(curretuser.test(value)){
}else{ window.alert("请输入字母或者数字!!!"); } } /*密码只能由数字或字母组成,长度为6~12位*/ function Password(){ var value = document.getElementById("password").value; var curretuser = /^[A-Za-z0-9]{6,12}$/;
</head>
<body>
<img src="images/lab0401.png" width="1350" height="100" >
<table cellpadding="5" cellspacing="0" border="0" bgcolor="#D3D3D3" >
<tr><td width="120" height="1"><li>首页面</li></td>
if(value==value1){
}else{ window.alert("两次输入的密码必须一样!!!"); } }
邮箱格式必须正确 function Email(){
var value = document.getElementById("email").value; var value1 = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; if(value1.test(value)){
<tr><td width="120" height="1"><li>个人管理</li></td><td></td></tr>
<tr><td width="120" height="1" ><ul><li>日程安排</li></ul></td></tr>
<tr><td width="120" height="1"><ul><li>工作记录</li></ul></td></tr>
<tr><td width="120" height="1"><li>企业管理</li></td><td> </td></tr>
<tr><td width="120" height="1"><ul><li>公司公告</li></ul></td></tr>
<tr><td width="120" height="1"><ul><li>工作会议</li></ul></td></tr>
color="#FF00FF">没账号?去注册</font> </a> </td> <td><input name="button" type="button" value="登录" onClick="User(),Password(),Checknumber()"/> </td> </tr>
</table> </div>
if(value1.test(value)){
}else{ window.alert("电话号码格式错误!!!"); } } 邮编书写符合规范 function Code(){ var value = document.getElementById("code").value; var value1 = /^\d{6}$/; if(value1.test(value)){
Reserved</td> </tr>
</table> </div>
</body> </html>
}else{ window.alert("邮箱格式错误!!!"); } 电话号码必须符合规范 function Phone(){ var value = document.getElementById("phone").value; var value1 = /^\d{3,4}\-?\d{8}$/;
if(curretuser.test(value)){
}else{ window.alert("错误!密码只能由数字或字母组成,长度为6-12位!!!"); } } /*两次密码必须一样*/ function TestPassword(){ var value = document.getElementById("password").value; var value1 = document.getElementById("password2").value;
}else{ window.alert("邮编格式错误!!!"); } }
Login(登录)页面: <style type="text/css"> .container {width: 400px;height: 400px;position:relative;} .B {position: absolute; top: 130px ; left: 200px ; bottom: 250px; right: 100px; } </style> <body bgcolor="#52BDFE">
<tr><td width="120" height="1"><li>退出</li></td></tr>
</table>
<div class="dqwz">
<table>
<p>当前位置:首页面
<a href="login02.jsp">【退出】</a></p>
</table>
</div>
<div class="welcome"> <table> <img src="images/lab0403.PNG"> </table>
相关主题