有什么问题请到<a href='/bbs/forums.php?fid=21'>论坛</a>中发表<br>
<!--# 特效来源:http://www.webjx.com/js -->
<!--把如下代码加入<body>区域中-->
<script Language="JavaScript">
<!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.info1.value == "")
{
alert("请在 \"用户名\" 域中输入值。");
theForm.info1.focus();
return (false);
}
if (theForm.info1.value.length < 1)
{
alert("在 \"用户名\" 域中,请至少输入 1 个字符。");
theForm.info1.focus();
return (false);
}
if (theForm.info1.value.length > 10)
{
alert("在 \"用户名\" 域中,请最多输入 10 个字符。");
theForm.info1.focus();
return (false);
}
if (theForm.info7.value == "")
{
alert("请在 \"出生年\" 域中输入值。");
theForm.info7.focus();
return (false);
}
if (theForm.info7.value.length < 4)
{
alert("在 \"出生年\" 域中,请至少输入 4 个字符。");
theForm.info7.focus();
return (false);
}
if (theForm.info7.value.length > 4)
{
alert("在 \"出生年\" 域中,请最多输入 4 个字符。");
theForm.info7.focus();
return (false);
}
var checkOK = "0123456789-.,";
var checkStr = theForm.info7.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("在 \"出生年\" 域中,只能输入 数字 个字符。");
theForm.info7.focus();
return (false);
}
if (decPoints > 1)
{
alert("请在 info7 域中输入一个有效数字。");
theForm.info7.focus();
return (false);
}
var chkVal = allNum;
var prsVal = parseFloat(allNum);
if (chkVal != "" && !(prsVal >= "1940" && prsVal <= "2000"))
{
alert("请在 \"出生年\" 域中输入值 大于或等于 1940 与 小于或等于 2000。");
theForm.info7.focus();
return (false);
}
if (theForm.info8.value == "")
{
alert("请在 \"出生月份\" 域中输入值。");
theForm.info8.focus();
return (false);
}
if (theForm.info8.value.length < 1)
{
alert("在 \"出生月份\" 域中,请至少输入 1 个字符。");
theForm.info8.focus();
return (false);
}
if (theForm.info8.value.length > 2)
{
alert("在 \"出生月份\" 域中,请最多输入 2 个字符。");
theForm.info8.focus();
return (false);
}
var checkOK = "0123456789-.,";
var checkStr = theForm.info8.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("在 \"出生月份\" 域中,只能输入 数字 个字符。");
theForm.info8.focus();
return (false);
}
if (decPoints > 1)
{
alert("请在 info8 域中输入一个有效数字。");
theForm.info8.focus();
return (false);
}
var chkVal = allNum;
var prsVal = parseFloat(allNum);
if (chkVal != "" && !(prsVal >= "1" && prsVal <= "12"))
{
alert("请在 \"出生月份\" 域中输入值 大于或等于 1 与 小于或等于 12。");
theForm.info8.focus();
return (false);
}
if (theForm.info9.value == "")
{
alert("请在 \"出生日期\" 域中输入值。");
theForm.info9.focus();
return (false);
}
if (theForm.info9.value.length < 1)
{
alert("在 \"出生日期\" 域中,请至少输入 1 个字符。");
theForm.info9.focus();
return (false);
}
if (theForm.info9.value.length > 2)
{
alert("在 \"出生日期\" 域中,请最多输入 2 个字符。");
theForm.info9.focus();
return (false);
}
var checkOK = "0123456789-,";
var checkStr = theForm.info9.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("在 \"出生日期\" 域中,只能输入 数字 个字符。");
theForm.info9.focus();
return (false);
}
var chkVal = allNum;
var prsVal = parseInt(allNum);
if (chkVal != "" && !(prsVal >= "1" && prsVal <= "31"))
{
alert("请在 \"出生日期\" 域中输入值 大于或等于 1 与 小于或等于 31。");
theForm.info9.focus();
return (false);
}
if (theForm.info15.value == "")
{
alert("请在 \"身份证件号码\" 域中输入值。");
theForm.info15.focus();
return (false);
}
if (theForm.info15.value.length < 10)
{
alert("在 \"身份证件号码\" 域中,请至少输入 10 个字符。");
theForm.info15.focus();
return (false);
}
if (theForm.info15.value.length > 30)
{
alert("在 \"身份证件号码\" 域中,请最多输入 30 个字符。");
theForm.info15.focus();
return (false);
}
var checkOK = "0123456789-.,";
var checkStr = theForm.info15.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("在 \"身份证件号码\" 域中,只能输入 数字 个字符。");
theForm.info15.focus();
return (false);
}
if (decPoints > 1)
{
alert("请在 info15 域中输入一个有效数字。");
theForm.info15.focus();
return (false);
}
if (theForm.info18.value == "")
{
alert("请在 \"邮政编码\" 域中输入值。");
theForm.info18.focus();
return (false);
}
if (theForm.info18.value.length < 6)
{
alert("在 \"邮政编码\" 域中,请至少输入 6 个字符。");
theForm.info18.focus();
return (false);
}
if (theForm.info18.value.length > 6)
{
alert("在 \"邮政编码\" 域中,请最多输入 6 个字符。");
theForm.info18.focus();
return (false);
}
var checkOK = "0123456789-.,";
var checkStr = theForm.info18.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("在 \"邮政编码\" 域中,只能输入 数字 个字符。");
theForm.info18.focus();
return (false);
}
if (decPoints > 1)
{
alert("请在 info18 域中输入一个有效数字。");
theForm.info18.focus();
return (false);
}
return (true);
}
//--></script>
<form method="POST" action="reg.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<table border="1" cellPadding="2" cellSpacing="0" align="left" class="itm" width=500>
<tr bgcolor="#E3E3E3">
<td colspan="3">请填写下述注册内容,注意:标有<font color="red" size="+2">*</font>的必须填写。</td>
</tr>
<tr>
<td align="right" width="68" bgcolor="#FFCE63">
<div align="left">用户名</div>
</td>
<td bgcolor="#FEE3A7" width="228">
<input name="info1" size="20" maxlength="10" value>
<font color="red" size="+2">*</font></td>
<td bgcolor="#FFF8E6" width="178">英文字符,<font color="#FF0000">最长10位</font></td>
</tr>
<tr>
<td align="right" width="68" bgcolor="#FFCE63">
<div align="left">口令</div>
</td>
<td bgcolor="#FEE3A7" width="228">
<input type="password" name="info2" size="20" maxlength="16" value>
<font color="red" size="+2">*</font></td>
<td bgcolor="#FFF8E6" width="178">英文字符和数字,最长16位</td>
</tr>
<tr>
<td align="right" width="68" bgcolor="#FFCE63">
<div align="left">确认口令</div>
</td>
<td bgcolor="#FEE3A7" width="228">
<input type="password" name="info3" size="20" maxlength="16" value>
<font color="red" size="+2">*</font></td>
<td bgcolor="#FFF8E6" width="178">请与您的口令保持一致&l