
已解决问题
谷歌123阿斯1用户在2014.05.25提交了关于“约基奇利用J**aScript模拟一个注册页面,使用h**TML制作,表单对象模拟注册页面,求大神”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2025-02-27T04:12:12。希望大家能够帮助她。详细问题描述及疑问:期待您的答案,你无异于雪中送炭,让我感激涕零 !
详细问题描述及疑问:期待您的答案,你无异于雪中送炭,让我感激涕零 !
只是写了昵称密码确认密
其余的自己写一下吧
就是这个格式
自己完成吧!
<html>
<head>
<metahttp-
<title>UntitledDocument</title>
<s
f
v
d
varname1=document.form1.text1
if(name1=
d
document.for
r
}
i
d
d
returnfalse;
}
varcharname
f
varcharna
i
d
document.***.select();
returnfalse;
}
}
returntrue;
}
functioncheckpassword(){
vardiv=document.getElementById("div2");
div.innerh**TML="";
varpassword=document.form1.text2.value;
if(password==""){
div.innerh**TML="密码不位空!";
document.form1.text2.focus();
returnfalse;
}
if(password.length<4||password.length>12){
div.innerh**TML="密码长度4-12位";
document.***.select();
returnfalse;
}
returntrue;
}
functioncheckrepassword(){
vardiv=document.getElementById("div3");
div.innerh**TML="";
varpassword=document.form1.text2.value;
varrepass=document.form1.text3.value;
if(repass==""){
div.innerh**TML="密码不位空!";
document.form1.text3.focus();
returnfalse;
}
if(password!=repass){
div.innerh**TML="输入密码和确认密码长度不一致";
document.***.select();
returnfalse;
}
returntrue;
}
functioncheckEmail(){
vardiv=document.getElementById("div4");
div.innerh**TML="";
varemail=document.form1.text5.value;
varsw=email.indexOf("@",0);
varsw1=email.indexOf(".",0);
vartt=sw1-sw;
if(email.length==0){
div.innerh**TML="电子邮件不能位空";
document.form1.text5.focus();
returnfalse;
}
if(email.indexOf("@",0)==-1){
div.innerh**TML="电子邮件格式不正确,必须包含@符号!";
document.***.select();
returnfalse;
}
if(email.indexOf(".",0)==-1){
div.innerh**TML="电子邮件格式不正确,必须包含.符号!";
document.***.select();
returnfalse;
}
if(tt==1){
div.innerh**TML="邮件格式不对。@和.不可以挨着!";
document.***.select();
returnfalse;
}
if(sw>sw1){
div.innerh**TML="电子邮件格式不正确,@符号必须在.之前";
document.***.select();
returnfalse;
}
else{
returntrue;
}
returnture;
}
functioncheck(){
if(checkname()&&checkpassword()&&checkrepassword()&&checkEmail()){
returntrue;
}
else{
returnfalse;
}
}
</script>
</head>
<body>
<formname="form1"method="post"action="2.html"onsubmit="returncheck()">
<table>
<tr>
<td>
用户名:
</td>
<td>
<inputid="text1"type="text"name="text1"onblur="check()">
<divid="div1"style="display:inline">
</div>
</td>
</tr>
<tr>
<td>
密码:
</td>
<td>
<inputid="text2"type="password"name="text2"onblur="check()">
<divid="div2"style="display:inline">
</div>
</td>
</tr>
<tr>
<td>
确认密码:
</td>
<td>
<inputid="text3"type="password"name="text3"onblur="check()">
<divid="div3"style="display:inline">
</div>
</td>
</tr>
<tr>
<td>
电子邮件地址:
</td>
<td>
<inputid="text4"type="text"name="text4"onblur="check()">
<divid="div4"style="display:inline">
</div>
</td>
</tr>
<tralign="center">
<tdalign="center">
<inputtype="submit"value="提交"name="tect6"><inputtype="reset"value="重置"name="text7">
</td>
</tr>
</table>
</form>
</body>
</html>