9

Credit card numbers on the cards themselves seem to follow a pattern--four clusters of digits separated by spaces. This seems to comport with "human factors engineering" that I think shows people have difficulty remembering more than four digits at a time, like, when one is reading the number out loud to a customer support soul.

Yet on web forms of all kinds, users are instructed to enter their credit card number without spaces, without hyphens-=-just 16 digits in a row. I.e., when "retailers" are collecting the most important piece of information from the buyer--they're making it nearly impossible for the user to verify her entry of a 16-digit number.

I have heard that some people make CGI scripts 'n' such to check up/validate input in information/data fields. Surely they can make a script that will accept spaces or hyphens in credit card numbers, then strip them out for the IT folks in the computer room. This makes it easier for the user to enter and double-check his entry before hitting "submit" or "cower" or "send"--and it gets the 16-digit string, no spaces, to the legacy computer system which no one knows how to program any more?

And one gratuitous question: Aren't user interfaces supposed to be designed to make things easier on the user who's trying to use the interface? A bad UI or GUI is like having a hammer with no handle. Sure, you can pound nails with the unadorned chunk of steel called the hammer head, but it goes a lot faster with the handle attached--and one that's not so long that you can't pound a nail with it, either--the goal here being driving nails with arms too short to box with God--but long enough to hold a nail in one hand, whilst starting (setting?) the nail with that first tap.

5
  • 2
    Why do they do it? Simple really - Because it's faster and easier to code it that way.
    – JonW
    Jan 14, 2015 at 13:41
  • Hmmm, this comes off as a bit of a rant, but I'll throw in an answer. The credit card companies don't put a hyphen or space in your credit card number do they? Why confuse the issue by formatting it this way in a UI?
    – Stephen
    Jan 14, 2015 at 22:33
  • And, whenever someone gives their credit card over the phone, they are expected to rattle off all 16 digits without any pauses? Most (all?) cards have spaces after every four or five digits. My statements for some cards reproduce those spaces; and other cards, they don't.
    – Kent
    Jan 14, 2015 at 23:45
  • There are several questions on this site that are dealing with how to do this properly, e.g. separate fields with auto-tabbing versus single fields with automatic dashes or spaces, also auto-completion. Reading the answers you will also learn that ISO 7812 puts special meaning to the first six and the last digit, also overall length varies from 12 to 19 digits. Smart implementations can use the IIN/BIN to auto-fill several tedious fields.
    – Crissov
    Jan 15, 2015 at 14:53
  • I'd like to belatedly counter any arguments that it's "faster and easier." The code to verify that a string only contains numbers will very likely be identical to code that removes any non-numbers from a string. Except if you're rejecting "invalid" credit card numbers, you also have to futz with your framework to throw out a validation message. The laziness isn't in the coding effort required, but in the cognitive effort to make the leap from "this is invalid, so bail" to "this is invalid, but we can make it valid."
    – millimoose
    Oct 19, 2015 at 23:19

5 Answers 5

7

There isn't really a "good" answer to your question, simply because they're engaged in bad practice.

While that sounds negative, the simple answer is that they are not considering the User Experience properly: a flaw many designers and developers have, and one which I'm guilty of displaying myself on occasion.

It may be that it takes too long, that they don't know how to, or simply that they haven't considered it.

1
  • It will sure be better when computers have credit card slots to engage the chip.
    – user67695
    May 30, 2017 at 19:16
4

Why do web designers force users to enter credit card numbers without hyphens or spaces?

Laziness.

In general, super-strict form field format requirements rarely benefits the end user. It's typically implemented that way due to lax parsing on the back end/status quo/low priority. Which is unfortunate.

2

Simplicity. Both in terms of implementation and in telling the user what is expected.

All users will understand what it means to enter the number with all digits and no dashes or spaces. Some small amount of customers will get confused if told that they can use dashes or spaces, and then they see their card only has spaces, no dashes.

Keep in mind there are a lot of different cards out there, with quite a few different formats. Not all of them are 16 digits in 4 blocks of 4.

Of course a proper implementation will tell the user to enter the number with all digits, but would gracefully remove any spaces and dashes from the input before moving on.


Of course there's also breaking the implementation of functionality into 2 parts:

  1. Make it work.
  2. Make it work well.

Occasionally the second part is skipped if someone decides that (1) is already good enough, and they don't want to invest time and money in what they see as a negligible improvement.

1

One reason that I've had to implement restrictions on spaces and dashes is that to get a mobile device to pop up the numeric keyboard instead of the full keyboard, it's useful to have a pattern="[0-9]*" property for greater browser support. For the moment, this is part of the only cross browser solution.

0

I have heard that some people make CGI scripts 'n' such to check up/validate input in information/data fields. Surely they can make a script that will accept spaces or hyphens in credit card numbers, then strip them out for the IT folks in the computer room. This makes it easier for the user to enter and double-check his entry before hitting "submit" or "cower" or "send"--and it gets the 16-digit string, no spaces, to the legacy computer system which no one knows how to program any more?

The reason it's not done as often as it should be is that that, for a lot of sites, this aspect of the form is handed to the developer as a task of the type: "Make it work." Developers don't usually think about user experience and it's easier for the developers to not add another level of validation. This made some sense in 1998 but it doesn't today.

There is no reason I can think of for a professional site to not add stripping non [0-9] inputs to the basic validation process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.