📄 zuoye.html
字号:
<!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=gb2312">
<title>注 册 页 面</title>
<style type="text/css">
<!--
table {
font-size: 9pt;
text-decoration: none;
border: 1px solid #000000;
}
.STYLE1 {
font-size: x-large;
color: #0000FF;
}
body {
background-color: #CCCC33;
}
-->
</style>
</head>
<body>
<script language=javascript>
function checkSubmit()
{//用户名不能为空
if ((document.form.username.value)=='')
{
window.alert ('用户名必须填写');
document.form.username.select();
document.form.username.focus();
return false;
}
//用户名的长度必须要在4到11位之间
if (document.form.username.value.length<4||document.form.username.value.length>10)
{
window.alert ('用户名长度必须在4位到10位之间');
document.form.username.select();
document.form.username.focus();
return false;
}
//密码不能为空
if ((document.form.password.value)=='')
{
window.alert ('密码必须填写');
document.form.password.select();
document.form.password.focus();
return false;
}
//密码长度的限制
if (document.form.password.value.length<6||document.form.password.value.length>14)
{
window.alert ('密码长度必须在6位到14位之间');
document.form.password.select();
document.form.password.focus();
return false;
}
//密码必须一致
if ((document.form.password.value)!=(document.form.password1.value)){
window.alert('密码与确认密码不一致!')
document.form.password1.select();
document.form.password1.focus();
return false;
}
//Email的测试
var emailStr=document.all.form.email.value;
var emailPat=/^(.+)@(.+)$/;
var matchArray=emailStr.match(emailPat);
if(emailStr==""){
window.alert("邮箱不能为空");
return false;
}
if (matchArray==null) {
alert("您的电子邮件有误,电子邮件地址必须包括 ( @ 和 . )")
return false;
}
//手机号不能为空
if(document.form.telNum1.value.length ==""){
window.alert("手机号不能为空");
document.form.telNum1.focus();
document.form.telNum1.select();
return false;
}
//手机号必须11位
if(document.form.telNum1.value.length !=11){
window.alert("手机号应该是11位");
document.form.telNum1.focus();
document.form.telNum1.select();
return false;
}
//测试手机号必须为数字
/*if(isNaN(document.form.telNum1.value)==false){
window.alert("手机号应该是数字");
document.form.telNum1.focus();
document.form.telNum1.select();
return false
}*/
if(document.form.telNum1.value.match(/^[1-9]\d*$/)==null)
{
alert("您输入的手机号不是数字!\n请确认后再重新输入!");
document.form.telNum1.select();
document.form.telNum1.focus();
return false;
}
if(document.form.telNum2.value != ""){
if(document.form.telNum2.value.length !=7&&document.form.telNum2.value.length !=8){
window.alert("小灵通号必须是7位或是8位\n请确认后再重新输入!");
document.form.telNum2.focus();
document.form.telNum2.select();
return false;
}
if(document.form.telNum2.value.match(/^[1-9]\d*$/)==null)
{
alert("您输入的小灵通号不全是数字!\n请确认后再重新输入!");
document.form.telNum2.select();
document.form.telNum2.focus();
return false;
}
}
//单选框是否选择了男人
if(CheckRadio(document.form.sex)=='男'&& document.form.address.value==''){
window.alert("您是男性必须填写地址!");
document.form.address.focus();
return false;
}
else
login();
return true;
}
function login(){
window.alert("恭喜您注册成功:"+document.form.username.value+"\n"+DateDemo());
}
//判断单选框是选择了男的还是女的
function CheckRadio(theRadio){
var theRadioLen = theRadio.length;
var theRadioValue = false;
if (theRadioLen == undefined){
if (theRadio.checked){
theRadioValue = theRadio.value;
}
}else{
for (theRadioI=0;theRadioI<theRadioLen;theRadioI++){
if (theRadio[theRadioI].checked){
theRadioValue = theRadio[theRadioI].value;
break;
}
}
}
return theRadioValue;
}
//日期的选择
function DateDemo(){
var d, s = "您注册的时间:"; // 声明变量.
d = new Date(); // 创建 Date 对象。
s += d.getYear()+ "-"; // 获取年份。
s += (d.getMonth() + 1) + "-"; // 获取月份。
s += d.getDate() ; // 获取日。
return(s); // 返回日期。
}
</script>
<form name="form" method="post" onsubmit="javascript:return checkSubmit()" action="season\part1.html">
<marquee>
<span class="STYLE1">欢迎大家进入本网站</span>
</marquee>
<hr color="">
<table width="491" border="0" align="center" cellpadding="5" cellspacing="0">
<tr align="center" bgcolor="#006699">
<td height="28" colspan="2"><font color="#FFFFFF">注 册 页 面</font></td>
</tr>
<tr align="center">
<td height=5></td>
</tr>
<tr align="center">
<td width="59" align="right">用户名:</td>
<td width="408" align="left"><input name="username" type="text" id="username">
<font color="#FF0000" face="宋体" size="2">*用户名长度必须在4位到10位之间</font></td>
</tr>
<tr align="center">
<td align="right">密码:</td>
<td align="left"><input name="password" type=password id="password">
<font color="#FF0000" face="宋体" size="2">*密码长度必须在6位到14位之间 </font></td>
</tr>
<tr align="center">
<td align="right">确认密码:</td>
<td align="left"><input name="password1" type=password id="password1">
<font color="#FF0000" face="宋体" size="2">*确认密码必须与密码一致</font></td>
</tr>
<tr align="center">
<td align="right">邮箱:</td>
<td align="left"><input name="email" type="text" id="email">
<font color="#FF0000" face="宋体" size="2">*邮箱必须填写</font></td>
</tr>
<tr align="center">
<td align="right">手机号:</td>
<td align="left"><input name="telNum1" type="text" id="telNum1"></td>
</tr>
<tr align="center">
<td align="right">小灵通号:</td>
<td align="left"><input name="telNum2" type="text" id="telNum2"></td>
</tr>
<tr align="center">
<td align="right">主页:</td>
<td align="left"><input name="homepage" type="text" id="homepage"></td>
</tr>
<tr align="center">
<td align="right">地址:</td>
<td align="left"><input name="address" type="text" id="address"></td>
</tr>
<tr align="center">
<td align="right">性别:</td>
<td align="left"><input name="sex" type="radio" value="男" checked>
男
<input type="radio" name="sex" value="女">
女 </td>
</tr>
<tr align="center">
<td align="right">头像:</td>
<td align="left"><input name="tou" type="radio" value="1" checked>
<img src='inmage/1.jpg'>
<input type="radio" name="tou" value="2">
<img src="inmage/2.jpg" >
<input type="radio" name="tou" value="3">
<img src="inmage/3.jpg" >
<input type="radio" name="tou" value="4">
<img src="inmage/4.jpg" >
<input type="radio" name="tou" value="5">
<img src="inmage/5.jpg" >
<input type="radio" name="tou" value="6">
<img src="inmage/6.jpg" > </td>
</tr>
<tr align="center">
<td align="right">个性签名:</td>
<td align="left"><input name="content" type="text" id="content" ></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" name="Submit" value="确认注册" >
<input type="reset" name="Submit2" value="重新输入"></td>
</tr>
</table>
</form>
</body>
</html>
<body>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -