Pretty severely broken on Firefox: can't type in a card number, and the "Fork me on GitHub" banner is missing. That second problem is particularly weird, I don't know what could be causing that. Also wondering if jQuery is really necessary for this.
Overall, it's a nice concept. I wish checkout forms were more intuitive.
Same problem here with Firefox, as well as an additional problem: the form captures all key input, such as an attempt to use ctrl-w to close the tab, or ctrl-t to open a new tab. Don't do that.
Please just let keys through normally, rely on inputmode="numeric" and possibly also pattern="\d+" to enforce numbers only, and at most only use manual key event processing as a fallback.
For a production ready alternative, take a look at http://creditcardjs.com, which was posted on HN a while back. The web site points out common mistakes when implementing credit card forms and delves into the motivation behind every design decision.
I am going to it satire. Anyhow, because then we would have birthday, zip code, telephone and custom ID number all wanted to be implemented. But it would be nice if there is an API in jQuery or in HTML that allows developer to specify the format of the input...
I know you're joking, but we do have all of those in html5.
We have birthday in the form of date (<input type="date">) and telephone (<input type="tel">). For US zip codes and custom-ids you could use type="range" or type="number".
You should be able to type "2/16" in the expiration, but instead when you try, you end up with "21 / 6".
I'm still amazed at how sites that can't handle spaces or dashes in the card number or want it formatted in 4 different text boxes. The actual card number worked very well on your form.
I'm going to be adding support for credit cards that aren't 15 or 16 digits later on. I stuck with 15 and 16 digits for now because it covers 90% of the use cases.
Turn away 10% of customers just at the moment they want to pay you, in order to boost conversion rate of the remaining 90% by 1%. This makes no sense.
My opinion is, stick with:
<input type="text">
I was on Hipmunk last week trying to book a hotel room, and I couldn't buy because the drop-down to select expiration date was overly engineered to the point it no longer triggered the spinner UI. Powered by Expedia! (iPhone 5 running iOS 6.1.2)
Overall, it's a nice concept. I wish checkout forms were more intuitive.