function preprocessForm() {
    
    /* DEFINE VALIDATION CONDITIONS */
    
    function validateForm() {
        
        var valid = true;
        var fieldsetDivs = $("fieldset > div:visible");
        
        /* Reset all invalid labels */
        $("label.invalid").removeClass("invalid");
        
        /* Validate text fields (must not be empty) */
        fieldsetDivs.find(":text").each(function () {
            if ($(this).attr("value") == "") {
                $(this).siblings("label").addClass("invalid");
                valid = false;
            }
        });
        
        /* Validate radio buttons (one must be selected) */
        fieldsetDivs.filter(":has(:radio)").each(function() {
            if ($(this).find(":checked").length == 0) {
                $(this).find("label").addClass("invalid");
                valid = false;
            }
        });
        
        /* Validate select fields (dummy cannot be selected) */
        fieldsetDivs.find("select").each(function() {
            if ($(this).attr("value") == 0) {
                $(this).siblings("label").addClass("invalid");
                valid = false;
            }
        });
        
        /* Return validation result */
        return valid;
    }
    
    
    /* PERFORM VALIDATION, ALERT AND CANCEL IF INVALID */
    
    if (validateForm() == false) {
        alert("Vor dem Absenden musst du alle Felder ausfüllen!");
        //self.location = "#reviseForm";
        
        return false;
    };
    
    
    /* SET NAME ATTRIBUTES OF PARTNERS */
    
    $(".player:visible").each(function(i) {
        $(this).find(".firstname-field").attr("name", "partner" + (i + 1) + "-firstname").end()
               .find(".lastname-field").attr("name", "partner" + (i + 1) + "-lastname").end()
               .find(".birthday-field").attr("name", "partner" + (i + 1) + "-birthday").end()
               .find(".birthmonth-field").attr("name", "partner" + (i + 1) + "-birthmonth").end()
               .find(".birthyear-field").attr("name", "partner" + (i + 1) + "-birthyear").end()
               .find(".instrument-field").attr("name", "partner" + (i + 1) + "-instrumentid");
    });
    
    
    /* SET NAME ATTRIBUTES OF PIECES */
    
    $(".piece:visible").each(function(i) {
        $(this).find(".title-field").attr("name", "piece" + (i + 1) + "-title").end()
               .find(".composer-field").attr("name", "piece" + (i + 1) + "-composer").end()
               .find(".composerdates-field").attr("name", "piece" + (i + 1) + "-composerdates").end()
               .find(".epoch-field").attr("name", "piece" + (i + 1) + "-epochid").end()
               .find(".duration-field").attr("name", "piece" + (i + 1) + "-duration");
    });
    
    
    /* GIVE GREEN LIGHT FOR SUBMISSION */
    return true;
}