Skip to main content
/*MBA readiness quiz*/ $(".mba-readiness").click(function (e) { /* Toggle Visibility of target route */ const target = $(this).data("anchor"); let opposite = ""; if (target === "#standard-entry") { opposite = "#accelerated-entry"; } else { opposite = "#standard-entry"; } /* Chain hide/show event */ $(opposite).hide("fast", function () { $("#select-route").hide("fast"); $("#entry-reset").show(); $(target).show("fast"); }); /* Prevent Anchor Default */ e.preventDefault(); }); $("#entry-reset").click(function () { /* cache all radio buttons */ const radios = $("input:radio"); /* set each radio prop to false */ $.each(radios, function () { $(this).prop("checked", false); }); /* hide reset button */ $(this).hide(); /* reset form elements to hidden */ $("#standard-entry, #accelerated-entry, #entry-form-results, #standard-entry-branch-a1, #standard-entry-branch-b1, #standard-entry-branch-b2-q1, #standard-entry-branch-b2-q2, #accelerated-entry-part-2, .entry-results").hide(); /* reopen starting step */ $("#select-route").show(); $("#mba-lead-gen-form").hide(); }); /* Standard Entry Buttons */ $("#standard-entry-radio-q1-yes").on("change", function () { $("#standard-entry-branch-b1").hide("fast"); $("#standard-entry-branch-a1").show("fast"); }); $("#standard-entry-radio-q1-no").on("change", function () { $("#standard-entry-branch-a1").hide("fast"); $("#standard-entry-branch-b1").show("fast"); }); $("#standard-entry-radio-q2-yes").on("change", function () { showResults("#standard-entry", "passed"); }); $("#standard-entry-radio-q2-no").on("change", function () { showResults("#standard-entry", "failed"); }); $("#standard-entry-radio-q3-yes").on("change", function () { $("#standard-entry-branch-b2-q2").hide("fast"); $("#standard-entry-branch-b2-q1").show("fast"); }); $("#standard-entry-radio-q3-no").on("change", function () { $("#standard-entry-branch-b2-q1").hide("fast"); $("#standard-entry-branch-b2-q2").show("fast"); }); $("#standard-entry-radio-q4-yes").on("change", function () { showResults("#standard-entry", "passed"); }); $("#standard-entry-radio-q4-no").on("change", function () { showResults("#standard-entry", "failed"); }); $("#standard-entry-radio-q5-yes").on("change", function () { showResults("#standard-entry", "passed"); }); $("#standard-entry-radio-q5-no").on("change", function () { showResults("#standard-entry", "failed"); }); /* Accelerated Entry Buttons */ $("#accelerated-entry-radio-q1-yes").on("change", function () { $("#accelerated-entry-part-2").show("fast"); }); $("#accelerated-entry-radio-q1-no").on("change", function () { showResults("#accelerated-entry", "standard"); }); $("#accelerated-entry-radio-q2-yes").on("change", function () { showResults("#accelerated-entry", "passed"); }); $("#accelerated-entry-radio-q2-no").on("change", function () { showResults("#accelerated-entry", "standard"); }); function showResults(elem, message) { /* input element */ const entry = $(elem); /* output element */ const target = "#entry-results-" + message; const results = $(target); /* actions */ entry.hide("fast"); results.show("fast"); $("#mba-lead-gen-form").show(); }