Contact Us

Contact Us

Contact Us

Discuss your Website

We take pride in serving our community and building lasting relationships with our clients.

Discuss your Website

We take pride in serving our community and building lasting relationships with our clients.

Discuss your Website

We take pride in serving our community and building lasting relationships with our clients.

import { useForm } from "framer"; import { useEffect } from "react"; export function FormValidator() { const { values, state, setError, setStep, submit } = useForm(); // Regex patterns const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; const phoneRegex = /^\+?[0-9\s\-]{7,15}$/; const validPostcodes = ["10115", "75001", "80331"]; // or fetch from JSON useEffect(() => { if (state === "submit") { const { email, telephone, PLZ } = values; if (!emailRegex.test(email)) { setError("email", "Invalid email"); setStep("error"); return; } if (!phoneRegex.test(telephone)) { setError("phone", "Invalid phone number"); setStep("error"); return; } if (!validPostcodes.includes(PLZ)) { setError("postcode", "Invalid postal code"); setStep("error"); return; } setStep("success"); submit(); // Continue to Zapier } }, [state]); return null; }