它不会验证,这是正确的做法吗?
我所有的表单验证功能都工作正常,但是当我单击submit
按钮时它不会验证
代码:
var pinvalid = 'false';
var emailvalid = 'false';
var confirmemailvalid = 'false';
var passwordvalid = 'false';
var confirmpassword = 'false';
//Validate PIN
$('#SUInpR_UserPin').keyup(function(){
checkAvailability();
});
// Validate Email
$('#SUInpR_Email').blur(function(){
checkEmail();
})
// Compare email address
$('#SUInpR_CEmail').blur(function(){
compareEmail();
})
//Check Password
$('#SUInpR_Password').blur(function(){
validatepassword();
})
// Comfirm Password
$('#SUInpR_PasswordConfirm').keyup(function(){
validatepasswordcheck();
})
//When signup button is click
$('#BtnGoSignUp').click(function(e){
if (pinvalid == 'true' ){
alert('Please check and make sure the all fields are entered');
}
else if(emailvalid == 'false'){
alert('Please Enter your email address');
}
else if(confirmemailvalid == 'false'){
alert('Please confirm your Email Address');
}
else if (passwordvalid == 'false'){
alert('Please Enter your password');
}
else if (confirmpassword == 'false'){alert('Please Confirm your Password');
}
else{
alert('all ok');
}