Please don't validate my name
26 Jan 2025
Every time I sign up for a new service, I'm often traumatised when having to enter my name. I have a simple Irish last name, what could go wrong? Well, a lot.
Every second website tells me I have invalid characters in my name! Since the internet was invented, you may no longer have an apostrophe in your name. When was the last time we actually worried about SQL injection?
Perhaps more triggering, some websites try to automatically format your name, so I have seen the second letter of my name automatically lowercased.
The robustness principle is best applied here: "be conservative in what you do, be liberal in what you accept from others". Nothing is gained by validating names, and it causes a lot of frustration, so why bother?
If you genuinely need to validate names for legal reasons, this would be covered by a KYC process. Until then let people have emojis in their names for all I care.
If you're a designer or a product manager, please think about it before deciding to add arbitrary validation rules to your forms. It's not just names, it's anything. If you're not sure, ask yourself, "what is the worst that could happen if I don't validate this?"
If you're a developer, this could be the hill you die on 😂.
Speaking of validation, here's the greatest stack overflow thread of all time...
Loading...