﻿$(document).ready(function() {
    $.each($("[hideWhenFilled='1']"), function(i, tr) {
        var hiderow = true;
        $.each($(tr).find("input,select"), function(j, inp) {
            if ($(inp).val() == '') {
                hiderow = false;
                return false;
            } else {
                hiderow = true;
            }
        });
        if (hiderow == true) {
            $(tr).hide();
            $("[hideWhenFilled='3']").hide(); //hide any element that is set to 3 Used for images and right graphics.
            $(tr).prev("[hideWhenFilled='2']").hide(); //hide previous row if its is set with a 2.
        }
    });
});
