求帮忙,我下面的语句错误了么?为什么限制的条件都不能运行提示框?
咸了烤鱼 2013-11-13 09:22:48 <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">{
function check(){
var.username=document.loginform.username.value;
var.userpass=document.loginform.userpass.value;
var.userpass2=document..getElementById("userpass").value;loginform.userpass2.value;
var mail=document.getElementById("email").value;
if(mail.indexOf("@")==-1){
alert("Email格式不正确\n必须包含@");
return false; }
if(username==null||username==""){
alert("用户名不能为空!");
return false;
}
for(var i=0;i<username.length;i++){
var j=username.substring(i,i+1)
if(j>=0){
alert("姓名中不能包含数字");
}
if(userpass==null||userpass==""||userpass.length<6){
alert("密码不能为空!");
return false;
}
if(userpass.length<6){
alert("密码必须等于或大于6个字符");
return false;
}
if(userpass!=userpass2){
alert("密码需一致!");
return false; }
}
return true;
}
</script>