I have the below code which is working fine:
success: function (upd_rsp){
//if email is not register
if(upd_rsp == "email_no"){
exstInfo.text("This E-mail is not registered in our Database!");
exstInfo.addClass("error");
return false;
}
//if email & pass don't match
if(upd_rsp == "email_pass_no"){
matchInfo.text("Email and Password don't match!");
matchInfo.addClass("error");
return false;
}
Now if I put between those 2 “if” an “else” statement (below), the second “if” does not get executed. Where am I wrong?
else{
exstInfo.text("");
exstInfo.removeClass("error");
return true;
}
Solution works just fine.
If you set a
returnvalue before the secondifis executed, the script will stop once thereturnis sent.This is one of the many ways you could do it: