<!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=utf-8" /> <title>无标题文档</title> <script language="javascript"> var a,b,c,d,e; function checkUserName(){ document.getElementById("erroruserNme").innerHTML="*"; var reguserNme=/^\w+$/; if(!reguserNme.test(document.login.userName.value)) document.getElementById("erroruserNme").innerHTML="用户名应为字母数字和下划线的组合"; else a=true; } function checkpwd(){
document.getElementById("errorpwd").innerHTML="*"; var regpwd=/^[0-9a-zA-Z]{6,16}$/; if(!regpwd.test(document.login.pwd.value)) document.getElementById("errorpwd").innerHTML="密码应为6-16位的数字或字母"; else b=true; } function checkpwdconf(){
document.getElementById("errorpwdconf").innerHTML="*"; if(document.login.pwd.value!=document.login.pwdconf.value) document.getElementById("errorpwdconf").innerHTML="两次密码不一致"; else c=true; } function checkEmail(){
document.getElementById("errorEmail").innerHTML="*"; var regEmail=/^\w+@\w+\.(\w+|\w+\.\w+)$/; if(!regEmail.test(document.login.Email.value)) document.getElementById("errorEmail").innerHTML="E-mail输入不合法"; else d=true; } function checkpersonID(){
document.getElementById("errorID").innerHTML="*"; var regID=/^(\d{15}|\d{18}|\d{17}[XxYy])$/; if(!regID.test(document.login.personID.value)) document.getElementById("errorID").innerHTML="身份不合法"; else e=true; } function sureform(){ if(a&&b&&c&&d&&e&&(document.login.sex[0].checked==true||document.login.sex[1].checked==true)&&document.login.readed.checked==true&&!(document.login.city[0].selected==true)) return true; else return false; } </script> </head> <body>
<form name="login" onsubmit="return sureform()" action="1.jsp"> <table width="367" height="793" border="1" align="center"> <tr> <td height="50" colspan="2" align="center">用户注测</td> </tr> <tr> <td width="123" height="54" align="right">用户名:</td> <td width="228"><input type="text" name="userName" onblur="checkUserName()"/><font color="#FF0000"><span id="erroruserNme">*</span></font></td> </tr> <tr> <td height="52" align="right">密 码:</td> <td align="left"><input type="password" name="pwd" onblur="checkpwd()" /><font color="#FF0000"><span id="errorpwd">*</span></font></td> </tr> <tr> <td height="55" align="right">确认密码:</td> <td><input type="password" name="pwdconf" onblur="checkpwdconf()"/><font color="#FF0000"><span id="errorpwdconf">*</span></font></td> </tr> <tr> <td height="61" align="right">性别:</td> <td><input type="radio" name="sex"/>男<input type="radio" name="sex" />女<font color="#FF0000"><span id="errorsex">*</span></font></td> </tr> <tr> <td height="62" align="right">城市:</td> <td align="left"> <select name="city"> <option>请选择</option> <option>江西</option> <option>上海</option> <option>北京</option> </select> </td> </tr> <tr> <td height="76" align="right">E-mal:</td> <td><input type="text" name="Email" onblur="checkEmail()")"/> <font color="#FF0000"><span id="errorEmail">*</span></font></td> </tr> <tr> <td height="71" align="right">身份证号码:</td> <td><input type="text" name="personID" onblur="checkpersonID()"/> <font color="#FF0000"><span id="errorID">*</span></font></td> </tr> <tr> <td height="71" colspan="2" align="right"> <textarea name="textarea" cols="50" rows="10"> 用户协议: 都是会计法的说法的数据库附近的身份就可怜的身份看见的反对法定积分点击放大使肌肤吊梨试佛就来到封疆大吏反对房贷首付的说法的说法的 </textarea></td> </tr> <tr> <td height="71" align="right">我已阅读有关协议:</td> <td><input type="checkbox" name="readed"/></td> </tr> <tr> <td align="right"><input type="submit" value="注册" /></td> <td><input type="reset" value="重置" /></td> </tr> </table> </form> </body> </html> |