function yan()
{
var zifuji = new Array ("1","2","3","4","5","6","7" ,"8" ,"9","a" ,"b" ,"c" ,"d" ,"e" ,"f" ,"g" ,"h" ,"j" ,"k" ,"l" ,"m" ,"n" ,"p" ,"q" ,"r" ,"s" ,"t" ,"u" ,"v" ,"w" ,"x" ,"y" ,"z")
var ma=""
for (var i=1;i<=4;i++)
{
ma=ma+zifuji[Math.floor(Math.random()*zifuji.length)];
}
document.getElementById("xianshi").value=ma;
}
function bianhong(x)
{
document.getElementById(x).style.borderColor="FF0000"
return;
}
function bianhuan(x)
{
document.getElementById(x).style.borderColor=""
return;
}
function yanzheng()
{
var username=document.getElementById("username").value;
if(username=="")
{
document.getElementById("cuowu").innerHTML=("用户名不能为空,请输入!");
document.getElementById("username").focus();
return false;
}
if(username.length<3||username.length>12)
{
document.getElementById("cuowu").innerHTML=("用户名输入错误,请重新输入!");
document.getElementById("username").select();
return false;
}
var pwd=document.getElementById("pwd").value;
if(pwd=="")
{
document.getElementById("cuowu").innerHTML=("密码不能为空,请输入!");
document.getElementById("pwd").focus();
return false;
}
if(pwd.length<6||pwd.length>15)
{
document.getElementById("cuowu").innerHTML=("密码输入错误,请重新输入!");
document.getElementById("pwd").select();
return false;
}
var tianma2=document.getElementById("tianma2").value;
if(tianma2=="")
{
document.getElementById("cuowu").innerHTML=("验证码不能为空,请输入!");
document.getElementById("tianma2").focus();
return false;
}
var Xianshi=document.getElementById("xianshi").value;
if (tianma2.toUpperCase()!=Xianshi.toUpperCase())
{
document.getElementById("cuowu").innerHTML=("验证码输入错误,请重新输入!");
document.getElementById("tianma2").select();
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="150" height="30" align="right">用户名:</td>
<td width="200" align="center"><input type="text" name="textfield" /></td>
<td>用户名为6-15位字母</td>
</tr>
<tr>
<td height="30" align="right">密码:</td>
<td align="center"><input type="text" name="textfield2" /></td>
<td> </td>
</tr>
<tr>
<td height="30" align="right">验证码:</td>
<td align="center"><input name="textfield3" type="text" size="10" />
<input name="textfield4" type="text" size="10" /></td>
<td> </td>
</tr>
<tr>
<td height="30" align="right"></td>
<td align="center"><input type="submit" name="Submit" value="提交" /></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
yan()
return false;
}
}
{
var zifuji = new Array ("1","2","3","4","5","6","7" ,"8" ,"9","a" ,"b" ,"c" ,"d" ,"e" ,"f" ,"g" ,"h" ,"j" ,"k" ,"l" ,"m" ,"n" ,"p" ,"q" ,"r" ,"s" ,"t" ,"u" ,"v" ,"w" ,"x" ,"y" ,"z")
var ma=""
for (var i=1;i<=4;i++)
{
ma=ma+zifuji[Math.floor(Math.random()*zifuji.length)];
}
document.getElementById("xianshi").value=ma;
}
function bianhong(x)
{
document.getElementById(x).style.borderColor="FF0000"
return;
}
function bianhuan(x)
{
document.getElementById(x).style.borderColor=""
return;
}
function yanzheng()
{
var username=document.getElementById("username").value;
if(username=="")
{
document.getElementById("cuowu").innerHTML=("用户名不能为空,请输入!");
document.getElementById("username").focus();
return false;
}
if(username.length<3||username.length>12)
{
document.getElementById("cuowu").innerHTML=("用户名输入错误,请重新输入!");
document.getElementById("username").select();
return false;
}
var pwd=document.getElementById("pwd").value;
if(pwd=="")
{
document.getElementById("cuowu").innerHTML=("密码不能为空,请输入!");
document.getElementById("pwd").focus();
return false;
}
if(pwd.length<6||pwd.length>15)
{
document.getElementById("cuowu").innerHTML=("密码输入错误,请重新输入!");
document.getElementById("pwd").select();
return false;
}
var tianma2=document.getElementById("tianma2").value;
if(tianma2=="")
{
document.getElementById("cuowu").innerHTML=("验证码不能为空,请输入!");
document.getElementById("tianma2").focus();
return false;
}
var Xianshi=document.getElementById("xianshi").value;
if (tianma2.toUpperCase()!=Xianshi.toUpperCase())
{
document.getElementById("cuowu").innerHTML=("验证码输入错误,请重新输入!");
document.getElementById("tianma2").select();
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="150" height="30" align="right">用户名:</td>
<td width="200" align="center"><input type="text" name="textfield" /></td>
<td>用户名为6-15位字母</td>
</tr>
<tr>
<td height="30" align="right">密码:</td>
<td align="center"><input type="text" name="textfield2" /></td>
<td> </td>
</tr>
<tr>
<td height="30" align="right">验证码:</td>
<td align="center"><input name="textfield3" type="text" size="10" />
<input name="textfield4" type="text" size="10" /></td>
<td> </td>
</tr>
<tr>
<td height="30" align="right"></td>
<td align="center"><input type="submit" name="Submit" value="提交" /></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
yan()
return false;
}
}