Lately, I seem to have found more web forms that are doing a ridiculously crappy job of validating the input data. It has, on occasion, gotten me yelling at my computer because I can’t understand what the owners of the site were thinking. Some of them are bad enough that they make me stop using the site, assuming that’s an option.
The other day, I had to enter a phone number. My password manager entered the phone number as
I submitted the form. The app told me my phone number was invalid. I, manually, change the phone number to:
I submitted the form again. Again, the app told me my phone number was invalid. I read the entire error message this time. I switched my phone number to:
I submitted the form and, voila, the stupid application finally accepted it.
On my banks website, I would paste in payment amounts. Most of the time, those amounts were formatted (e.g. $1,234.55). When I submitted the payment, my bank would tell me I entered an invalid dollar amount. I had to remove the dollar sign and the comma to get them to accept the amount. (My bank has since fixed this problem).
Also on my banks website, I have some bills go straight to the bank. Occasionally, I’ll submit a payment for a bill the bank received, making no changes. When I submit the payment, the site tells me I provided an invalid date. That makes me yell since I didn’t provide the date. I then realize the date falls on a non-banking day so I fix it and submit the payment again.
These problems have one big thing in common. The web app can’t recognize valid data and it is making this my problem. It shouldn’t be my problem the site can’t recognize a valid phone number. It shouldn’t be my problem the site can’t recognize a valid dollar amount. It shouldn’t be my problem that the site can’t fix a date or identify the difference between an actual invalid date and a data that is not an option.
Validations are necessary to ensure an app can do stuff with the data. Sometimes that stuff is for me; sometimes it is for the owner of the app. Validations are critical to keeping applications running.
But validations that require following a strict formatting guide are not. Make validations flexible. Computers are good at parsing data. Support all valid formats. Support unformatted input. Fix data before you display it. Make things easy for your user. Because a happy user is the best reference you can get.