I had everything working. But I realized I needed to use one of MailChimp’s landing pages and not a form inside for Wix. For some reason, I can’t link to an external page. It works if I use internal pages.
Thoughts?
import wixData from "wix-data";
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
export function searchzip_click_1(event) {
let SearchValue = $w("#searchbar").value
$w("#dataset2").setFilter(wixData.filter().contains('zipCodes', SearchValue))
.then(() => {
let count = $w("#dataset2").getTotalCount();
if (count === 0) {
wixLocation.to("/out-of-range");
}
else {
wixLocation.to("https://mailchi.mp/surroundins.com/in-area");
}}
)}