<div class="codetitle"> <span><a style="CURSOR: pointer" data="79764" class="copybut" id="copybut79764" onclick="doCopy('code79764')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code79764"> <br> <br> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><title>用户注册</title> <br><script language="javascript"> <BR><!-- <BR>function MyForm(){ <BR>msg.innerHTML="debug::in function"; <BR>var username = document.form1.username.value; <BR>var msg = document.getElementById("msg"); <BR>if(username.length==0){ <BR>msg.innerHTML="[ 提示:用户名不能为空! ]"; <BR>document.form1.username.focus(); <BR>return false; <BR>} <BR>var pass = document.form1.password.value; <BR>if(pass.length==0){ <BR>msg.innerHTML="[ 提示:密码不能为空! ]"; <BR>document.form1.password.focus(); <BR>return false; <BR>} <BR>var pass1 = document.form1.password1.value; <BR>if(pass1.length==0){ <BR>msg.innerHTML="[ 提示:确认密码不能为空! ]"; <BR>document.form1.password1.focus(); <BR>return false; <BR>} <BR>if(pass1!=pass){ <BR>msg.innerHTML="[ 提示:您两次输入的密码不一致! ]"; <BR>document.form1.passwoid.focus(); <BR>return false; <BR>} <BR>var mail = document.form1.mail.value; <BR>if(mail.length==0){ <BR>msg.innerHTML="[ 提示:E_mail不能为空! ]"; <BR>document.form1.mail.focus(); <BR>return false; <BR>} <BR>var i = form1.mail.value.indexOf("@"); <BR>var j = form1.mail.value.indexOf("."); <BR>if((i<0)||(j<0)||(i-j>0)) <BR>{ <BR>msg.innerHTML="[ 提示:您输入的E_mail格式不正确,请正确输入! ]"; <BR>document.form1.mail.focus(); <BR>return false; <BR>} <BR>msg.innerHTML=""; <BR>return true; <BR>} <BR>--> <BR></script> <br> <br> <br><form id="form1" name="form1" method="post" action="" onsubmit="return MyForm()"> <br><table width="389" border="1" align="center" cellpadding="5"> <br><tr> <br><td colspan="2"><div align="center">用户注册<br> </div></td> <br> </tr> <br><tr> <br><td colspan="2" align="center" bordercolor="">bgcolor=""> <br><font color="red"><span id="msg">${error}</span> </font> <br> </td> <br> </tr> <br><tr> <br><td width="71">用户名:</td> <br><td width="286"> <label> <br><input name="username" type="text" id="username" size="20"> <br></label> <br>*(必填)</td> <br> </tr> <br><tr> <br><td>用户密码:</td> <br><td> <label> <br><input name="password" type="password" id="password" size="20"> <br></label> <br>*(必填)</td> <br> </tr> <br><tr> <br><td>重复密码:</td> <br><td> <label> <br><input name="password1" type="password" id="password1" size="20"> <br></label> <br>*(必填)</td> <br> </tr> <br><tr> <br><td>电子邮件:</td> <br><td> <label> <br><input name="mail" type="text" id="mail" size="25"> <br></label> <br>*(必填)</td> <br> </tr> <br><tr> <br><td>电话:</td> <br><td><label> <br><input name="tel" type="text" id="tel" size="22"> <br></label></td> <br> </tr> <br><tr> <br><td>QQ:</td> <br><td><label> <br><input name="qq" type="text" id="qq" size="22"> <br></label></td> <br> </tr> <br><tr> <br><td colspan="2"><label> <br><div align="center"> <br><input type="submit" name="Submit" value="注册"> <br><input type="reset" name="Submit2" value="重置"> <br> </div> <br></label></td> <br> </tr> <br> </table> <br> </form> <br> <br> <br> </div>