?? 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 + -