// Twin Cities Metro ZIP Code List const metroZips = new Set([ "55001","55003","55005","55010","55011","55014","55016","55020","55024","55025", "55031","55033","55038","55042","55043","55044","55047","55054","55055","55065", "55068","55070","55071","55073","55075","55076","55077","55079","55082","55083", "55085","55090","55092","55101","55102","55103","55104","55105","55106","55107", "55108","55109","55110","55111","55112","55113","55114","55115","55116","55117", "55118","55119","55120","55121","55122","55123","55124","55125","55126","55127", "55128","55129","55130","55133","55144","55145","55146","55150","55155","55161", "55164","55165","55166","55168","55169","55170","55171","55172","55175","55177", "55187","55188","55191","55303","55304","55305","55306","55311","55315","55316", "55317","55318","55322","55323","55327","55331","55337","55339","55340","55343", "55344","55345","55346","55347","55348","55352","55356","55357","55359","55360", "55361","55364","55367","55368","55369","55372","55373","55374","55375","55378", "55379","55383","55384","55386","55387","55388","55391","55392","55393","55394", "55397","55399","55401","55402","55403","55404","55405","55406","55407","55408", "55409","55410","55411","55412","55413","55414","55415","55416","55417","55418", "55419","55420","55421","55422","55423","55424","55425","55426","55427","55428", "55429","55430","55431","55432","55433","55434","55435","55436","55437","55438", "55439","55440" ]); // Run logic when Tally is ready Tally.on("ready", function () { // Watch for changes on the zip_code field Tally.on("answer", function (answer) { if (answer.fieldKey === "zip_code") { const enteredZip = (answer.value || "").trim(); const isOutsideMetro = enteredZip.length === 5 && !metroZips.has(enteredZip); // Show eviction_foreclosure question only if ZIP is outside the metro list Tally.setFieldVisibility("eviction_foreclosure", isOutsideMetro ? "visible" : "hidden"); } }); });