// Contact page with form validation + stylized map function Contact() { const D = window.MS_DATA; const [form, setForm] = React.useState({ name: "", email: "", phone: "", msg: "", ack: false }); const [errs, setErrs] = React.useState({}); const [captcha, setCaptcha] = React.useState(false); const [sent, setSent] = React.useState(false); const set = (k, v) => { setForm({ ...form, [k]: v }); if (errs[k]) setErrs({ ...errs, [k]: null }); }; const formatPhone = (v) => { const d = v.replace(/\D/g, "").slice(0, 10); if (d.length < 4) return d; if (d.length < 7) return `(${d.slice(0,3)}) ${d.slice(3)}`; return `(${d.slice(0,3)}) ${d.slice(3,6)}-${d.slice(6)}`; }; const validate = () => { const e = {}; if (!form.name.trim() || !form.name.trim().includes(" ")) e.name = "Please enter your first and last name."; if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email)) e.email = "Please enter a valid email address."; if (form.phone.replace(/\D/g,"").length !== 10) e.phone = "Please enter a 10-digit phone number."; if (form.msg.trim().length < 20) e.msg = "Please provide at least a brief description (20+ characters)."; if (!form.ack) e.ack = "Acknowledgement required."; if (!captcha) e.captcha = "Please verify you are not a robot."; return e; }; const submit = (ev) => { ev.preventDefault(); const e = validate(); setErrs(e); if (Object.keys(e).length === 0) { setTimeout(() => setSent(true), 300); } }; return (
Inquiries · Contact

Learn how our firm
can help you.

Communications through this form do not create an attorney-client relationship. For matters requiring immediate counsel, please contact the office directly by telephone.

Physical Office
1660 Hickory Loop
Las Cruces, New Mexico 88005
Mailing Address
P.O. Box 2699
Las Cruces, New Mexico 88004-2699
Telephone · Email
{D.firm.phone}
{D.firm.email}
Hours
Monday – Friday · 8:30 am – 5:30 pm MST
By appointment outside office hours
{/* Roads */} {/* Parcels */} {/* Labels */} HICKORY LOOP N MAIN ST
Mynatt Springer P.C.
{sent ? (

Thank you.

We have received your inquiry and will respond within one business day. A copy has been sent to {form.email}.

) : ( <>

Send an inquiry

All fields required. Responses within one business day.

set("name", e.target.value)} placeholder="First Last"/> {errs.name &&
{errs.name}
}
set("email", e.target.value)} placeholder="you@company.com"/> {errs.email &&
{errs.email}
}
set("phone", formatPhone(e.target.value))} placeholder="(xxx) xxx-xxxx"/> {errs.phone &&
{errs.phone}
}
{form.msg.length} / 20+ characters
{errs.msg &&
{errs.msg}
}
{errs.ack &&
{errs.ack}
}
setCaptcha(!captcha)}>{captcha && }
I'm not a robot reCAPTCHA
{errs.captcha &&
{errs.captcha}
} )}
); } window.Contact = Contact;