My gripe is the preponderance of unnecessary client-side form validation on simple, run-of-the-mill contact forms, information-request forms, and the like. In other words, what 90% of forms are all about—the rather important matter of allowing your customers to contact you.
What is the point of client-side form validation?
- It provides visitors with a more seamless user experience.
- It reduces server load.
The latter is, in my personal experience, a moot point these days, unless a site has an exceptional amount of traffic. Which leaves us with the first point: providing visitors with a more seamless user experience.
Your visitors are infinitely smarter than your code
Form validation is very closely linked with the topic of “required” form information, and they both boil down to the same thing: you can’t force people to give you (genuine) information that they don’t want to give you.
Being a pedantic little git about the format of a ‘phone number isn’t going to convince those users not wishing to give you their number that maybe they should after all. It’s just going to annoy those people who genuinely do want to give you their contact details.
And who’s to say your vistor’s way of writing a telephone number is “wrong”, and yours is “right” anyway (anyone mentioning E.164 at this point is missing the point)? Do you really want to lose a customer simply because he puts brackets around his dialing code?
Just keep it simple
The best approach is to just keep things simple.
Rather, it should gently remind your visitor when he has forgotten to enter his name. And if it was a deliberate omission, well, then you get another M. Mouse to add to your database.
However, it can annoy genuine customers, and make your company look like a collection of inconsiderate pedants. Use it, but use it wisely.