- 论坛徽章:
- 0
|
<script Language="JavaScript">
function FormCheck(theform)
{
if (theform.user.value =="")
{
alert("请填写您的用户名!");
theform.user.focus();
return false;
}
var filter=/^\\s*[.A-Za-z0-9_-]{5,15}\\s*$/;
if (!filter.exec(theform.user.value)) {
alert("用户名填写不正确,请重新填写!可使用的字符为(A-Z a-z 0-9 _ - .)长度不小于5个字符,不超过15个字符,注意不要使用空格。");
theform.user.focus();
theform.user.select();
return false;
}
if (theform.pass.value =="")
{
alert("请填写您的密码!");
theform.pass.focus();
return false;
}
if(theform.confirmPassword.value==""){
alert("请输入您的确认密码!");
theform.confirmPassword.focus();
return false;
}
var filter=/^\\s*[.A-Za-z0-9_-]{5,15}\\s*$/;
if (!filter.exec(theform.pass.value)) {
alert("密码填写不正确,请重新填写!可使用的字符为(A-Z a-z 0-9 _ - .)长度不小于5个字符,不超过15个字符,注意不要使用空格。");
theform.pass.focus();
theform.pass.select();
return false;
}
if (theform.pass.value!=theform.confirmPassword.value ){
alert("两次填写的密码不一致,请重新填写!");
theform.pass.focus();
theform.pass.select();
return false;
}
if (theform.email.value =="")
{
alert("请输入您的电子邮件地址!");
theform.email.focus();
theform.email.select();
return false;
}
var filter=@;
if (!filter.test(theform.email.value)) {
alert("邮件地址不正确,请重新填写!");
theform.email.focus();
theform.email.select();
return false;
}
<!-- theform.submit() -->
}
</script>
<body>
<form name="theform" method="post" action="" onsubmit="return FormCheck(this);">
<table width="59%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td width="38%" class="text2"><div align="right">用户名:</div></td>
<td width="62%"><div align="left">
<input type="text" name="user">
<span class="text2">英文和数字结合</span></div></td>
</tr>
<tr>
<td class="text2"><div align="right">密码:</div></td>
<td><div align="left">
<input type="text" name="pass">
</div></td>
</tr>
<tr>
<td class="text2"><div align="right">密码确认:</div></td>
<td><div align="left">
<input type="text" name="confirmPassword">
</div></td>
</tr>
<tr>
<td class="text2"><div align="right">邮箱地址:</div></td>
<td><div align="left">
<input type="text" name="email">
<span class="text">*用于密码忘记时取回!</span></div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="注册" >
</div></td>
</tr>
</table>
</form> |
|
|