Profile

unixronin: Galen the technomage, from Babylon 5: Crusade (Default)
Unixronin

December 2012

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Expand Cut Tags

No cut tags
Tuesday, April 21st, 2009 09:20 am

You’re ordering auto parts online.  The order form requires a mandatory phone number.  It allows ten digits for the phone number.

You enter your phone number with area code:  xxxxxxxxxx

The scripting on the form automatically reformats the phone number to make it “pretty”, like this:  (xxx) xxx-xxxx

And then it all goes pear-shaped, because NEXT the field length limiting script kicks in and truncates that to ten characters:  (xxx) xxx-

So, you can’t submit your order form without a valid phone number.

And you can’t submit your order form with a valid phone number, because by the time you hit submit, the form has automatically invalidated it.

FAIL.

Tags:
Tuesday, April 21st, 2009 01:55 pm (UTC)
Yikes, not only is that parsing full of fail, it isn't even doing anything remotely useful, unless their backend design has separate fields for the area code, exchange number, and 4 digit phone number. If I was designing it, the input field would accept about 20 characters, then the validation script would strip all non-numeric characters, test that the numer was exactly 10 digits, then store those 10 digits. The phone number ie easier to manipulate as a nice clean 10 digit string, and can easily be prettified when it is output.

If I wanted to be really fancy I could even check for common errors when validating the phone number. For example if there were 11 digits I chould check if the first digit is a 1. If so remove it and recheck the validity of the number.