Forum Moderators: phranque
* Allow only alphabetic Characters in Name ( John O'Connor has to wait!)
* Prevent punctuation characters (like ;(semi-colon) ' and " (quotes)) in a text field
(afraid of email injection?)
So I thought of writing an article on bad form validations.
Have you seen such restrictive, funny form validations? could you share your experience?
Forms that do not allow punctuation in company names. My legal company name may be "ABC, Inc." so don't make me write "ABC Inc" instead. (And what about the case where "A-B-C Corp." may be a completely different legal entity from "ABC Corp." or "A B C Corp."- how could the first person distinguish his company from the others?)
Forms that only allow numeric entries for ZIP Codes. Many countries use alphanumeric codes (Canada, U.K.) or dashes (South Korea).
And one of my biggest complaints- forms that only allow the 50 U.S. states (plus DC) for state abbreviations, completely disallowing Guam / Puerto Rico (and other U.S. territories) and APO/FPO (overseas U.S. military) addresses.
btw our French codes are number only ..but some US sites wont validate with them .( cos they dont look like US zip codes ).even when you chooose "country"="France"
[edited by: Leosghost at 5:43 pm (utc) on Aug. 4, 2009]
It's not just email injection, if you've ever been put through the SecurityMetrics wringer there are far more dangers in user input. For characters that may or may not be problematic but used in normal English, you have to consider they are only a danger in combination with OTHER meta characters. It's not as simple as it all seems.
At least by "silently" removing suspect characters, the orders/queries will still go through, only throw errors that are truly errors.
Not trying to validate sloppy coding, just saying, there are often more important reasons and if a developer doesn't know how to "fix" it they are indeed safer protecting the site than leaving it open to attack. In the end, the site's visitors suffer.
Useful thread on this by DrDoc [webmasterworld.com]