If I'm entering a credit card number, let me type the fucking spaces. Use JS to trim them before they hit the server if you have to. I once used a site that had JS specifically to prevent me from typing a space, and it was infuriating, because exactly the same amount of engineering effort could have gone into just letting me type it the way I wanted to.