📄 login.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GB2312"
pageEncoding="GB2312"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>Insert title here</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:25px;
top:48px;
width:300px;
height:250px;
z-index:1;
background:#F9F0B7;
}
-->
</style>
<script type="text/javascript">
var ReturnValue;
function ChooseFace(){
ReturnValue=window.showModalDialog("ChooseFacePage.jsp",window,"dialogWidth=500px;dialogHeight=500px;status=no;toolbar=no");
if(ReturnValue&&ReturnValue!=""){
var str=ReturnValue;
document.all.userface.src="manFace/"+str;
document.all.face.value="manFace/"+str;
}
}
function checkInfo(){
var name=document.all.UerName.value;
var password1=document.all.password1.value;
var password2=document.all.password2.value;
var area=document.all.Area.value;
var emile=document.all.Emile.value;
//检查是否为空
if(name==""||password1==""||password2==""||emile==""
||name==null||password1==null||password2==null||emile==null)
{
alert("请勿把带*的选项选上");
return false;
}
for(var i=0;i<name.length;i++){
var chat=name.charAt(i);
if(chat==" "){
alert("名字中不可以带空格");
return false;
}
}
for(var i=0;i<=9;i++){
if(name.charAt(0)==i) {
alert("名字不能以数字开头");
return false;
}
}
if(password1!=password2){
alert("两次输入的密码不相符");
return false;
}
if(password1.length<6){
alert("密码长度至少6位");
return false;
}
if(emile.indexOf("@")==-1||emile.indexOf(".com")==-1){
alert("邮箱输入不正确");
return false;
}
if(area.length>50){
alert("抱歉用户留言不能超过50字");
return false;
}
return true;
}
</script>
</head>
<body background="bg2.jpg">
<div id="Layer1">
<form name="login" action="succeedRegister.jsp" onSubmit="return checkInfo()">
<table border=1 bgcolor="#F9F0B7" align="left" bordercolor="#000000" style="font-size:15px; font-family:'宋体'">
<tr>
<td width="104"><font color=red>*</font>用户名:</td>
<td width="145"><input name="UerName" type="text" size="20" maxlength="10" title="注册后不能修改"></td>
</tr>
<tr>
<td><font color=red>*</font>密码:</td><td><input name="password1" type="password" size="21" maxlength="10" title="填写密码"></td>
</tr>
<tr>
<td><font color=red>*</font>验证密码:</td><td><input name="password2" type="password" size="21" maxlength="10" title="确认密码"></td>
</tr>
<tr>
<td><font color=red>*</font>性别:</td><td>
<input name="sex" type="radio" value="man" checked="checked"/>男
<input name="sex" type="radio" value="woman"/>女
</tr>
<tr>
<td> 头像</td><td><input type="button" value="选择头像" onClick="ChooseFace()"> <input type=image name='userface' src="manFace/1_m.bmp" disabled="ture">
<input name="face" type="hidden" value="manFace/1_m.bmp" maxlength=15 size="20"></td>
</tr>
<tr>
<td><font color=red>*</font>电子邮箱:</td><td><input name="Emile" type="text" size="20" maxlength="20"></td>
</tr>
<tr>
<td>QQ:</td><td><input name="QQ" type="text" size="20" maxlength="15"></td>
</tr>
<tr>
<td>国家省份</td><td><input name="Province" type="text" size="20" maxlength="10"></td>
</tr>
<tr>
<td colspan="2" align="center"><textarea name="Area" cols="30" rows="5" title="用户留言(不超过50字)">用户留言(不超过50字)</textarea></td>
</tr>
<tr>
<td colspan="2"align="center"><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -