|
|
|
| Hurry! Enter The Daily WTF's OMGWTF2 Contest by June 28th! - Prizes! Fame! Trophies! Do your worst: http://omg2.thedailywtf.com/ |
| « Fruity Loop | SQL Splits » |
Recently, Marc came upon a dilemma that all car owners can relate to - his next oil change was due soon.
Hoping to take advantage of Midas' online appointment scheduler, he found his nearest Midas garage at http://midaslocator.com/ and started entering his information. Unfortunately, when it came time enter his address information, Marc noticed something peculiar - the form validation wouldn't accept his zip code, or any zip code for that matter.
Viewing the source of the page, he discovered this line containing the regular expression being used to validate zip codes:
dnn_ctr685_UIComponentInjector_ctl00_ZipPostalCodeRegEx.validationexpression ="(^d{5}(-d{4})?$)|(^[ABCEGHJKLMNPRSTVXY|abcdeghjklmnprstvxy][0-9][A-Z|a-z](-)?( )?[0-9][A-Z|a-z][0-9]$)";
As it turned out, the script was using 'd' instead of '\d' to denote a number...however, this didn't change the fact that the zip code is a required field.
The work around?
After entering 'ddddd' for his zip code, Marc was able to successfully schedule an oil change.
|
Ah, zip codes. Sometimes I long for those days where you could enter an international address on site from an American company, but you still needed to provide a zip code. And a state.
In fact, the hλlf-wits at Valve insist to this very day that I fill in a state, which I dutifully fill in as 'n/a'. Please note that the country I live in has just over 420,000 inhabitants, and has no need for states. But on the other hand, our postal codes are so accurate that I suspect that each house has its own postal code. |
| « Fruity Loop | SQL Splits » |