$(document).ready(function() {
    $("#registerform").submit(function() {
        var errors = "";
        if ($("#firstname").val() == "") {
            errors += "Please fill in the 'Firstname' input field.<br/>";
        }
        if ($("#lastname").val() == "") {
            errors += "Please fill in the 'Lastname' input field.<br/>";
        }
        if ($("#email").val() == "") {
            errors += "Please fill in the 'E-mail' input field.<br/>";
        }
        if (errors != "") {
            $("#errors").html(errors);
            $("#errors").show(300);
            return false;
        }
        return true;
    });
});