现在我有几下几个问题:
1,我的用户名,密码,等信息填写的是错误的,依然可以注册成功
2,我的邮箱验证的有问题,不知道是哪里出问题了,其他的信息填写的是错误的,邮箱填写的是错的依然可以注册成功,
3,如何在页面上判断验证码是否正确。????? 在业务逻辑层,我会判断,
在业务落脚处声明一个字段 private String yazheng;
然后在如下判断就ok了,但是我在页面不知道要怎么判断,
if(!this.getSession().getAttribute("rand").equals(this.getYazheng())
小弟虚心求教,希望各位高手,帮帮忙,。。。。。
//js 验证
function xianshi(){
var name = document.getElementById("name").value;
var errorname = document.getElementById("error");
var pwd = document.getElementById("pwd").value;
var kongpwd=document.getElementById("kong");
var error1=document.getElementById("error1");
var pwd1 = document.getElementById("pwd1").value;
var quekong = document.getElementById("quekong");
var error2=document.getElementById("error2");
var mytext1 = document.getElementById("mytext1").value;
var realname=document.getElementById("realname");
var names=document.getElementById("names");
var email = document.getElementById("email").value;
var emkong=document.getElementById("emkong");
var error3=document.getElementById("error3");
/*var yanz= document.getElementById("yanz").value;
var yankong = document.getElementById("yankong");*/
if(name=="" || name==null){
errorname.style.display="block";
return false;
}
if(pwd=="" || pwd==null){
kongpwd.style.display="block";
error1.style.display="none";
return false;
}
if(pwd1=="" || pwd1==null){
quekong.style.display="block";
error2.style.display="none";
return false;
}
if(mytext1=="" || mytext1==null){
realname.style.display="block";
names.style.display="none";
return false;
}
if(email=="" || email==null){
emkong.style.display="block";
error3.style.display="none";
return false;
}
else{
document.queren.submit();
return true;
}
}
function checkRealyname(){
var mytext1 = document.getElementById("mytext1").value;
var names = document.getElementById("names");
var realname=document.getElementById("realname");
if(mytext1=="" || mytext1==null){
names.style.display="block";
realname.style.display="none";
return false;
}
}
function checkNames()
{
var xiao = document.getElementById("xiao");
var zhi = document.getElementById("zhi");
var error = document.getElementById("error");
xiao.style.display="block";
zhi.style.display="none";
error.style.display="none";
kong.style.display="none";
}
function checkmima(x,z,e,k){
var xiao = document.getElementById(x);
var zhi = document.getElementById(x);
var error = document.getElementById(e);
var kong = document.getElementById(k);
xiao.style.display="block";
zhi.style.display="none";
error.style.display="none";
kong.style.display="none";
}
function checkName(){
var xiao = document.getElementById("xiao");
var zhi = document.getElementById("zhi");
var error = document.getElementById("error");
var name = document.getElementById("name").value;
var cz=document.getElementById("cz");
var namePattern=/^[A-Za-z0-9](\w|\.|-){3,16}[A-Za-z0-9]$/;
if(!namePattern.exec(name)){