Good catch, and a useful instinct to generalise — "did it even run" is the first question, not the last. Worth adding one security framing while you're in here: both the browser's native checks and your own isEmail() run in the visitor's browser, so they're really UX, not a control. Anyone can post straight past them with novalidate in devtools, curl, or an intercepting proxy, so whatever receives this form server-side still needs to re-check format, length and required before it trusts or stores anything. Treat client-side validation as the convenience layer and server-side as the one that actually holds.
My Validation Code Was Fine. It Just Never Ran.
7 Comments
@[Tarek-Elzoghby] Exactly right on the Referer check, Tarek — it's client-set, so it thins out drive-by spam but anyone posting directly can omit or forge it; treat it as a filter, never a gate. The one control fully in your hands, since Formspree won't do it, is escaping the submission wherever it's rendered — the email, any dashboard — so a malicious field can't execute even when every input filter happens to be off.
@[DunimeTech] Agreed, a filter and not a gate. One note on my setup: submissions only go to Formspree's notification email and dashboard, so I don't render them in any page or tool of my own, which means escaping isn't something I control today. It would become mine the moment I pulled submissions into my own code, and I'll keep that in mind if I do. Thanks for the detailed thread. It covered a side of this form that the post doesn't.
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
More From Tarek-Elzoghby
Related Jobs
- Digital Product Manager (Infrastructure as Code) in SpringfieldEnergy Jobline ZR · Full time · Springfield, MO
- Programmeur backend sénior (gestion de code source et CI/CD)Epic Games (French) · Full time · Canada
- Senior React Developer - Job Code: 1783978742784Coconut · Full time · New York, NY
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!