最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

用戶(hù)注冊(cè)常用javascript代碼

 更新時(shí)間:2009年08月29日 01:00:35   作者:  
用戶(hù)注冊(cè)常用javascript代碼,大家可以保存運(yùn)行看下效果。
復(fù)制代碼 代碼如下:

<%@ page contentType="text/html; charset=gb2312" language="java"%>
<!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>用戶(hù)注冊(cè)</title>
<script language="javascript">
function IsDigit(cCheck)
{
return (('0'<=cCheck) && (cCheck<='9'));
}

function IsAlpha(cCheck)
{
return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z')))
}

function IsValid()
{
var struserName = reg.UserName.value;
for (nIndex=0; nIndex<struserName.length; nIndex++)
{
cCheck = struserName.charAt(nIndex);
if (!(IsDigit(cCheck) || IsAlpha(cCheck)))
{
return false;
}
}
return true;
}
function chkEmail(str)
{
return str.search(/[\w\-]{1,}@[\w\-]{1,}\.[\w\-]{1,}/)==0?true:false
}

function docheck()
{
if(reg.UserName.value=="")
{
alert("請(qǐng)?zhí)顚?xiě)用戶(hù)名");
return false;
}
else if(!IsValid())
{
alert("用戶(hù)名只能使用字母和數(shù)字");
return false;
}
else if(reg.UserPassword.value=="")
{
alert("請(qǐng)?zhí)顚?xiě)密碼");
return false;
}
else if(reg.UserPassword.value != reg.CUserPassword.value)
{
alert("兩次密碼不一致");
return false;
}
else if(reg.NickName.value =="")
{
alert("請(qǐng)?zhí)顚?xiě)昵稱(chēng)");
return false;
}
else if(reg.Email.value =="")
{
alert("請(qǐng)?zhí)顚?xiě)郵箱");
return false;
}
else if(!chkEmail(reg.Email.value))
{
alert("請(qǐng)?zhí)顚?xiě)有效的Email地址");
return false;
}
else
{
return true;
}
}
</script>
<STYLE type=text/css>
td, th {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
line-height: 24px;
color: #333333;
}
</STYLE>
</head>
<body>
<h1 align="center">用戶(hù)注冊(cè)</h1>
<div align="center">
<form name="reg" action="user_add.jsp" method="post" target="_self" onSubmit="return docheck()">
<table width="90%" border="0">
<tr>
<td width="50%" align="right" height="25"><font face="Arial, Helvetica, sans-serif">請(qǐng)輸入要注冊(cè)的用戶(hù)名:</font></td>
<td width="50%" align="left" height="25">
&nbsp;<input type="text" name="UserName">
<br>
<font color="red">&nbsp;用戶(hù)名只能由字母和數(shù)字組成</font>
</td>
</tr>
<tr>
<td width="50%" align="right" height="25">請(qǐng)輸入密碼:</td>
<td width="50%" align="left" height="25">&nbsp;<input type="password" name="UserPassword"></td>
</tr>
<tr>
<td width="50%" align="right" height="25">請(qǐng)輸入確認(rèn)密碼:</td>
<td width="50%" align="left" height="25">&nbsp;<input type="password" name="CUserPassword"></td>
</tr>
<tr>
<td width="50%" align="right" height="25">請(qǐng)輸入昵稱(chēng):</td>
<td width="50%" align="left" height="25">&nbsp;<input type="text" name="NickName"></td>
</tr>
<tr>
<td width="50%" align="right" height="25">請(qǐng)選擇性別:</td>
<td width="50%" align="left" height="25">&nbsp;<input type="radio" name="Sex" value="0" checked>男&nbsp;<input type="radio" name="Sex" value="1">女</td>
</tr>
<tr>
<td width="50%" align="right" height="25">請(qǐng)輸入Email地址:</td>
<td width="50%" align="left" height="25">&nbsp;<input type="text" name="Email"></td>
</tr>
</table>
<p>
<input type="submit" name="sub" value="注冊(cè)">&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" name="res" value="重填">
</p>
</form>
</div>
</body>
</html>

相關(guān)文章

最新評(píng)論

平塘县| 墨玉县| 重庆市| 彩票| 兴安县| 高州市| 蓬莱市| 广饶县| 沁水县| 华池县| 霍山县| 阿拉善盟| 沈丘县| 芮城县| 梁河县| 穆棱市| 西充县| 安国市| 微山县| 肥乡县| 南部县| 家居| 南阳市| 得荣县| 庆安县| 屏东市| 潍坊市| 孝感市| 那曲县| 扎囊县| 留坝县| 交口县| 启东市| 镇平县| 竹溪县| 天全县| 浪卡子县| 平舆县| 江安县| 盐池县| 新和县|