<form action="" onsubmit="return proving(user,psw,repsw,sex,city,like,text)">
这里面proving函数的参数有问题,user,psw,repsw,sex,city,like,text
你这样传参,值都是空的啊
这里不需要传参,<form action="" onsubmit="return proving()">
函数应该是这样:
function proving(){var user = document.getElementById('user')
var psw = document.getElementById('psw')
......
var reg = /[^\d]\w{7,15}/
var pswreg = /\w{6,16}/
if(!reg.match(user.value)||user.value=="")
{
alert("请输入正确的用户名或用户名为空")
return false
}
......
}
function login(){if (document.login.usename.value== "logon" && document.login.password.value =="logon") {
location.href="main.html"
}else{
return false
}
}