I can’t really take the high road when it comes to defensive HTML form flexibility. I distinctly remember trying to convince our designer at my last job that trimming extra spaces at the end of a URL wasn’t necessary because the user wouldn’t have typed them if they didn’t actually want them there.
Sometimes, though, it amazes me how lazy web developers can be on high-traffic sites. For example, I was searching for flights on Travelocity and entered the date as “12/21/05”. The resulting error page showed that the server actually interpreted that as December 21st, year 0005! I think I’d have to actually go out of my way to mis-parse a date that badly.
Some sites don’t mis-parse the date like that, but they have bizarre requirements on date formats. When I download my account history from Washington Mutual, I always enter it as 7/2/05 and get an error because they require leading zeroes — 07/02/2005.
So I started a Greasemonkey script that will let you enter dates in whatever standard format you please. It will swap your format for the site’s preferred format when you submit the form. For now, it only works with the two sites that annoyed me this week — wamu.com and travelocity.com. But I wrote it in a way that it can easily be extended to other sites.
You can get the script, but keep in mind that it’s my first Greasemonkey script so it might do horrible things to your browser. Unlikely though — it’s pretty straight forward.