
function validateForm(form) {

    var isValid = true;
    var msg = "";
    var already = "";
    // Check each field individually

    if(form.email.value.length == 0) {
        msg += "Please fill in your email adress!";
        isValid = false;
        already = "1";
    }

    if (already != "1") {
        var checkMail = (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/);
        if (form.email.value.search(checkMail) == -1) {
            msg += "Please fill in your email right";
            isValid = false;
        } 
    }
    
    // Show the error message to the user
    if(!isValid) alert(msg);

return isValid;
}
