<div class="codetitle"> <span><a style="CURSOR: pointer" data="63787" class="copybut" id="copybut63787" onclick="doCopy('code63787')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code63787"> <br><script language="javascript"> <BR>function IsDigit(cCheck) <BR>{ <BR>return (('0'<=cCheck) && (cCheck<='9')); <BR>} <BR>function IsAlpha(cCheck) <BR>{ <BR>return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z'))) <BR>} <BR>function IsaNull(cCheck) <BR>{ <BR>return(cCheck != " ") <BR>} <BR>function checkform() <BR>{ <BR>id = document.sform1.id.value; <BR>if (id == "") <BR>{ <BR>alert("请输入注册名"); <BR>document.sform1.id.focus(); <BR>return false; <BR>} <BR>for (nIndex=0; nIndex<id.length; nIndex++) <BR>{ <BR>cCheck = id.charAt(nIndex); <BR>if (!(IsDigit(cCheck) || IsAlpha(cCheck) || cCheck=='-' || cCheck=='_' || cCheck=='.')) <BR>{ <BR>alert("用户名只能使用字母、数字以及-、_和.,并且不能使用中文"); <BR>document.sform1.id.focus(); <BR>return false; <BR>} <BR>} <BR>chineseid = document.sform1.chineseid.value; <BR>if (chineseid == "") <BR>{ <BR>alert("请输入中文昵称"); <BR>document.sform1.chineseid.focus(); <BR>return false; <BR>} <BR>password = document.sform1.password.value; <BR>if (password == "") <BR>{ <BR>alert("请输入登陆密码"); <BR>document.sform1.password.focus(); <BR>return false; <BR>} <BR>password1 = document.sform1.password1.value; <BR>if (password>password1) <BR>{ <BR>alert("重复密码与登陆密码不相同"); <BR>document.sform1.password.focus(); <BR>document.sform1.password1.focus(); <BR>return false; <BR>} <BR>if (password<password1) <BR>{ <BR>alert("重复密码与登陆密码不相同"); <BR>document.sform1.password.focus(); <BR>document.sform1.password1.focus(); <BR>return false; <BR>} <BR>if (document.sform1.email.value == "") <BR>{ <BR>alert("请输入您的E-MAIL地址"); <BR>document.sform1.email.focus(); <BR>return false; <BR>} <BR>email=document.sform1.email.value; <BR>emailerr=0 <BR>for (i=0; i<email.length; i++) <BR>{ <BR>if ((email.charAt(i) == "@") & (email.length > 5)) <BR>{ <BR>emailerr=emailerr+1 <BR>} <BR>} <BR>if (emailerr != 1) <BR>{ <BR>alert("请输入正确的E-MAIL地址"); <BR>document.sform1.email.focus(); <BR>return false; <BR>} <BR>if (document.sform1.checkask.value=="") <BR>{ <BR>alert("密码提示问题不能为空"); <BR>document.sform1.checkask.focus(); <BR>return false; <BR>} <BR>if (document.sform1.checkans.value=="") <BR>{ <BR>alert("您的密码提示问题答案不能为空"); <BR>document.sform1.checkans.focus(); <BR>return false; <BR>} <BR>return true; <BR>} <BR></script><br> </div>