If you’re planning to go on an overnight trip, let’s say to the next town, you won’t carry your two changes of clothes in a full size suitcase because that would be insane. The suitcase would be too large. You don’t stuff them into your pockets either because pockets are too small for clothes. You use an overnight bag instead while reserving the suitcase for longer trips and your pants pockets for something like a handkerchief, neck tie, or pocket square.
Form fields work the same way. The length should always match the expected length otherwise your customers will be left confused and start worrying that they’ve done something wrong. Take the credit card security code field for example. That’s a field that requires either three or four digits. Having a 10-digit field only serves to make your customers worry about whether they filled in the correct number since it looks like there is a lot of vacant space.
When considered in terms of length, form fields fall into two broad categories:
- Fixed length fields
- Variable length fields
Fixed length fields
These are fields like the credit card number (14-16 digits), the security code (3 or 4 digits), zip codes within the same country (5-6 digits in the US), phone numbers, and dates.
For such fields, the length should not extend beyond the maximum possible value. That means the security code field shouldn’t support more than four digits and zip code fields shouldn’t support more than six digits.
Phone number, and zip code lengths can vary greatly from country to county so you need to keep that in mind when targeting international customers.
Variable length fields
These are the name, place, and email fields. While there could be pretty short names like Jon Cox and rather long ones like William Arthur Harrington-McMilan, a lot of the names tend to fall in between the extremes. Place names follow the same trend so the standard practice is to have a field that can support any standard length names while still leaving a little space for the super long ones.