modelAttribute="user">
name="confirmPassword" class="loginpwd" placeholder="确认密码" />
οnclick="registerInspection()">注册
function registerInspection() {
var name = document.formRegisterName.name;
var password = document.formRegisterName.password;
var confirmPassword = document.formRegisterName.confirmPassword;
var email = document.formRegisterName.email;
alert(name + "\n" + password + "\n" + confirmPassword
+ "\n" + email);
/* if(name.value.length==0){
alert("请输入用户名!");
name.focus();
return false;
}
if(password.value==""||password.value==null){
alert("请输入密码!");
password.focus();
return false;
}
if(confirmPassword.value==""||confirmPassword.value==null){
alert("请输入确认密码!");
confirmPassword.focus();
return false;
}
if(email.value==""||email.value==null){
alert("请输入邮箱!");
email.focus();
return false;
}
return true; */
if (!inspect(name) || !inspect(password)
|| !inspect(confirmPassword) || !inspect(email)) {
return false;
}
document.formRegisterName.submit();
alert("成功!");
return true;
}
function inspect(variable) {
if (variable.value == "" || variable.value == null
|| variable.value == undefined) {
alert("填写完整注册信息!");
variable.focus();
return false;
}
else{
return true;
}
}