In the following code how can I still have the second and third statement executed even if the first one returns false?
// so in this one if Required fails I dont get the email error :(
function validate() {
if (checkRequired(myForm.requiredElements)
&& checkEmail(myForm.emailInputs)
&& checkTelephone(myForm.telInputs)) {
return true;
}
else {
return false;
}
}
Use the single-ampersand version of and, it doesn’t shortcircuit like the double-ampersand one.