Skip to content

Commit

Permalink
Contact form email validation. #90
Browse files Browse the repository at this point in the history
  • Loading branch information
OudomMunint committed Aug 17, 2024
1 parent b94234b commit e7f5a19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ function ContactForm() {
<label className="form-label" htmlFor="email"></label>
<input className="form-control input" type="email" id="email" name="email" value={email} onChange={(e) => 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"
/>
</div>

{/* Message */}
Expand Down

0 comments on commit e7f5a19

Please sign in to comment.