From e7f5a19441f4b0a50c7b9cac3492656c4ca89105 Mon Sep 17 00:00:00 2001 From: OudomMunint Date: Sun, 18 Aug 2024 00:09:08 +1000 Subject: [PATCH] Contact form email validation. #90 --- src/components/Contact.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Contact.js b/src/components/Contact.js index 06f9372..c6b0663 100644 --- a/src/components/Contact.js +++ b/src/components/Contact.js @@ -73,7 +73,10 @@ function ContactForm() { setEmail(e.target.value)} placeholder="Email" - required /> + required + pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}" + title="Please enter a valid email address" + /> {/* Message */}