免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1933 | 回复: 0
打印 上一主题 下一主题

为什么不行呢 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-09 18:25 |只看该作者 |倒序浏览
<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">
&nbsp;&nbsp;<tr>
&nbsp;&nbsp;&nbsp;&nbsp;<td width="38%" class="text2"><div align="right">用户名:</div></td>
&nbsp;&nbsp;&nbsp;&nbsp;<td width="62%"><div align="left">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="user">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="text2">英文和数字结合</span></div></td>
&nbsp;&nbsp;</tr>
&nbsp;&nbsp;<tr>
&nbsp;&nbsp;&nbsp;&nbsp;<td class="text2"><div align="right">密码:</div></td>
&nbsp;&nbsp;&nbsp;&nbsp;<td><div align="left">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="pass">
&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
&nbsp;&nbsp;</tr>
&nbsp;&nbsp;<tr>
&nbsp;&nbsp;&nbsp;&nbsp;<td class="text2"><div align="right">密码确认:</div></td>
&nbsp;&nbsp;&nbsp;&nbsp;<td><div align="left">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="confirmPassword">
&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
&nbsp;&nbsp;</tr>
&nbsp;&nbsp;<tr>
&nbsp;&nbsp;&nbsp;&nbsp;<td class="text2"><div align="right">邮箱地址:</div></td>
&nbsp;&nbsp;&nbsp;&nbsp;<td><div align="left">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="email">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="text">*用于密码忘记时取回!</span></div></td>
&nbsp;&nbsp;</tr>
&nbsp;&nbsp;<tr>
&nbsp;&nbsp;&nbsp;&nbsp;<td colspan="2"><div align="center">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="注册" >
&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
&nbsp;&nbsp;</tr>
</table>
</form>
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP