News for hackers. Stuff that matters.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by Sir_Cmpwn on Saturday January 25, 2014 @10:11PM (#7123677)
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.

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by JoshTriplett on Saturday January 25, 2014 @11:04PM (#7123822)
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.

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by vezzy-fnord on Saturday January 25, 2014 @10:18PM (#7123697)
Firefox 26.0 on Slackware 14 here.

Can't type in a card number either, although the "Fork me on GitHub" banner is there just fine.

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by User8712 on Saturday January 25, 2014 @10:31PM (#7123731)
Same, Firefox 26.0 on Windows 8, I can't enter anything into the input fields aside from name on card.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by wcummings on Saturday January 25, 2014 @11:13PM (#7123857)
I haven't used slack since the kde4 switch, how is Slackware doin these days? Worth fussing w/?
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by johnjwang on Saturday January 25, 2014 @10:31PM (#7123732)
Thanks for the feedback. Sorry about that, I'm working to get a fix - hopefully later tonight.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by johnjwang on Sunday January 26, 2014 @12:14AM (#7123980)
Should be mostly fixed now for Firefox. Still working on a couple of bugs.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by davekt on Saturday January 25, 2014 @11:43PM (#7123929)
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.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by nostromo on Saturday January 25, 2014 @10:21PM (#7123705)
Why isn't <input type="card"> a thing?
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by yeukhon on Saturday January 25, 2014 @11:53PM (#7123944)
I know right?!

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...

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by nostromo on Sunday January 26, 2014 @12:08AM (#7123966)
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".

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by yeukhon on Sunday January 26, 2014 @12:22AM (#7123998)
Yeah I know the first two, I wasn't aware of range actually. Looks like browsers still have a long way to catch up each other.

http://caniuse.com/#search=input%20type

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by jlatt on Sunday January 26, 2014 @12:27AM (#7124014)
Zipcodes are not numbers. As a counterexample, MA has codes beginning with 02, e.g. 02135.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by cpwright on Saturday January 25, 2014 @10:47PM (#7123774)
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.

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by johnjwang on Saturday January 25, 2014 @10:53PM (#7123796)
Ah good catch - thanks for pointing it out. I'll fix this later tonight.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by humbyvaldes on Saturday January 25, 2014 @10:54PM (#7123798)
How about making the placeholder text lighten up a bit on focus. Something like this for webkit should work

:focus::-webkit-input-placeholder { color: #eee;}

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by johnjwang on Saturday January 25, 2014 @11:25PM (#7123883)
Thanks, that sounds like a good idea. I'll be adding this on pretty soon.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by coherentpony on Saturday January 25, 2014 @11:13PM (#7123856)
And for those of us not using Safari or Google Chrome?
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by humbyvaldes on Saturday January 25, 2014 @11:25PM (#7123884)
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by wcummings on Saturday January 25, 2014 @11:17PM (#7123868)
Degrade gracefully
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by rwaldron on Saturday January 25, 2014 @11:13PM (#7123851)
There isn't a single test in the repo.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by johnjwang on Saturday January 25, 2014 @11:27PM (#7123892)
Ya I know. I just made this very recently, so I haven't had a chance to make any tests yet. Rest assured, tests are coming!
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by ragsagar on Saturday January 25, 2014 @10:40PM (#7123755)
unable to type card number and cvc in firefox 26.0
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by notastartup on Saturday January 25, 2014 @10:11PM (#7123681)
this is great but I like to use https://www.paymentiframe.com/

the form resembles a credit card.

Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by apineda on Saturday January 25, 2014 @11:55PM (#7123947)
I still can't understand the reasoning behind iframe, can you please kindly explain to me why?
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by notastartup on Sunday January 26, 2014 @12:05AM (#7123964)
The iframe lets you drop it into your app.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by victorhn on Saturday January 25, 2014 @10:28PM (#7123721)
It lets me put more than 16 digits.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by sjtgraham on Saturday January 25, 2014 @10:39PM (#7123753)
Some card schemes support PANs longer than 16 digits.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by saurik on Saturday January 25, 2014 @11:12PM (#7123849)
Yeah; if a credit card form doesn't let the user type more than 16 digits there is something seriously wrong with the form ;P.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by johnjwang on Saturday January 25, 2014 @11:22PM (#7123877)
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.
Re:Show HN: I'm open sourcing Creditly.js, an intuitive cred... by zaroth on Sunday January 26, 2014 @01:47AM (#7124166)
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)