?? reg.asp
字號:
?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>會員注冊</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
.STYLE2 {font-size: small}
.f_one { BACKGROUND: #ffffff
}
-->
</style>
</head>
<SCRIPT language=javascript type=text/javascript>
var lastname = "";
var msg=new Array(
"<font color=\"red\">用戶名長度錯誤!</font>",
"<font color=\"red\">此用戶名包含不可接受字符或被管理員屏蔽,請選擇其它用戶名</font>",
"<font color=\"red\">為了避免論壇用戶名混亂,用戶名中禁止使用大寫字母,請使用小寫字母</font>",
"<font color=\"red\">該用戶名已經(jīng)被注冊,請選用其他用戶名。</font>",
"<font color=\"green\">恭喜您,該用戶名還未被注冊,您可以使用這個用戶名注冊!</font>"
);
function namecheck() {
var username = document.getElementById("regname").value;
if (username == "") {
return false;
}
if (username == lastname) {
return false;
}
lastname = username;
document.checkForm.username.value = username;
document.getElementById("check_info").innerHTML = "檢測中,請稍等...";
document.checkForm.submit();
return true;
}
function retmsg(id){
document.getElementById("check_info").innerHTML = msg[id];
}
</SCRIPT>
<body>
<form id="register" name="register" onSubmit="return regcheck(this);" method="post" action="checkreg.asp">
<table width="738" height="213" align=center cellpadding="3" cellSpacing=1 bgColor=#3399cc >
<TBODY>
<tr>
<td colspan="2"> 注冊信息</td>
</tr>
<tr>
<td width="257" bgcolor="#FFFFFF"><span class="STYLE2">用戶名</span><span class="STYLE1">*</span></td>
<td width="477" bgcolor="#FFFFFF"><input id="regname" class="f_one" maxlength="14" name="regname" />
<input name="check" type="button" id="check" onclick="return namecheck();" value="檢查用戶名" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="STYLE2">密碼<span class="STYLE1">*</span></td>
<td bgcolor="#FFFFFF"><input name="regpwd" type="password" class="f_one" id="regpwd"
onchange="checkpwd();" maxlength="16" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="STYLE2">確認密碼<span class="STYLE1">*</span></td>
<td bgcolor="#FFFFFF">
<input name="regpwdrepeat" type="password" class="f_one" id="regpwdrepeat"
onchange="checkpwdrepeat();" maxlength="16" /> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="STYLE2">性別</td>
<td bgcolor="#FFFFFF"><label>
<input name="regsex" type="text" class="f_one" id="regsex" maxlength="4" />
</label></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="STYLE2">E-mail</td>
<td bgcolor="#FFFFFF">
<input
name="regemail" class="f_one" id="regemail" onchange="checkemail();" maxlength="16" /> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="STYLE2">QQ</td>
<td bgcolor="#FFFFFF">
<input id="regqq" maxlength="16" class="f_one" onchange="checkemail();"
name="regqq" /> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="STYLE2">電話</td>
<td bgcolor="#FFFFFF">
<input maxlength="16" name="regtel" id="regtel" class="f_one" /> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="STYLE2">地址</td>
<td bgcolor="#FFFFFF">
<input maxlength="50" name="regadd" id="regadd" class="f_one" /> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF" class="STYLE2"><div align="center">
<input type="submit" value="提 交" name="regsubmit" />
<input type="reset" name="reset" id="reset" value="重 設" />
<a href="login.asp">返回</a>
</div></td>
</tr>
</TBODY>
</table>
</form>
<SCRIPT language=JavaScript1.2>
document.register.regname.focus();
function showimage(imgpath,value)
{
if(value!= '') {
document.images.useravatars.src=imgpath+'/face/'+value;
} else{
document.images.useravatars.src=imgpath+'/face/none.gif';
}
}
function regcheck(formct){
if (formct.regname.value=='' || formct.regpwd.value=='' || formct.regpwdrepeat.value==''){
alert('會員名或密碼為空,請?zhí)顚?#039;);
return false;
}
if (formct.regpwd.value!=formct.regpwdrepeat.value){
alert('兩次輸入的密碼不一致,請檢查后重試。');
return false;
}
if (formct.regpwd.value.length<6){
alert('密碼太少,請用6位以上');
return false;
}
formct.regsubmit.disabled=true;
}
function checkpwd(){
var pwd = document.getElementById("regpwd").value;
var pwdrepeat = document.getElementById("regpwdrepeat").value;
if (pwd.length<6){
document.getElementById("pwd_info").innerHTML = "<font color=\"red\">密碼太少,請用6位以上</font>";
} else{
document.getElementById("pwd_info").innerHTML = "";
}
if(pwdrepeat){
checkpwdrepeat();
}
}
function checkpwdrepeat(){
var pwd = document.getElementById("regpwd").value;
var pwdrepeat = document.getElementById("regpwdrepeat").value;
if (pwdrepeat==pwd){
document.getElementById("pwdrepeat_info").innerHTML = "";
} else{
document.getElementById("pwdrepeat_info").innerHTML = "<font color=\"red\">兩次輸入的密碼不一致,請檢查后重試。</font>";
}
}
function checkemail(){
var email = document.getElementById("regemail").value;
var myReg = /^[-a-zA-Z0-9_\.]+@([0-9A-Za-z][0-9A-Za-z-]+\.)+[A-Za-z]{2,5}$/;
if(myReg.test(email)){
document.getElementById("email_info").innerHTML = "";
} else{
document.getElementById("email_info").innerHTML = "<font color=\"red\">Email 格式錯誤!</font>";
}
}
</SCRIPT>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -