I'm trying to run through a series of forms on a quiz. I need it to alert the user if they have left one of the answers out. If they have left more than one out, I need to send more than one alert.
function validate(){
if ((q2Check() === true) && (q1Check() === true)){
return true;
}
else{
return false;
}
}
The code snippet above is the section that checks all the questions returning true. Currently only have 2 questions in it. The alerts are in the individual question functions. My problem is, if both questions have been left unanswered, only the q2Check alert is shown, presumably because that one is returning false so it no longer needs to check the rest of the conditions.
Is there a way to get it to check all conditions, thus bringing up all the alerts?
Aucun commentaire:
Enregistrer un commentaire