News for hackers. Stuff that matters.
Re:jQuery.payment by sethist on Thursday February 07, 2013 @02:51PM (#5184140)
This looks nice, but I ran into an immediate usability issue. The Card Expiry requires a leading 0 for January. It seems like bad UI to prevent a user from enter 1/13 or 1/2013 in those fields.
Re:jQuery.payment by maccman on Thursday February 07, 2013 @02:53PM (#5184150)
We don't prevent that. If you type '1/' the library turns it into '01 / '.
Re:jQuery.payment by sethist on Thursday February 07, 2013 @02:55PM (#5184169)
Fair enough, I haven't dug into the code yet. I was basing my comment on the live demo which prevents it.
Re:jQuery.payment by dasil003 on Thursday February 07, 2013 @03:22PM (#5184282)
Huh? If you literally type '1/13' into the live demo it works as one would expect. '113' works too, it just assumes the month is eleven, and the year starts with 3.
Re:jQuery.payment by silentkevin on Thursday February 07, 2013 @08:44PM (#5185785)
If you literally type '1/13' into the live demo it interprets it as '11/3' because it does not allow a '/' character to be entered as cpeterso mentioned
Re:jQuery.payment by sethist on Thursday February 07, 2013 @03:39PM (#5184361)
I was referring to the live demo at http://stripe.github.com/jquery.payment/example/. Either way, I wouldn't consider the library interpreting 113 as 11/3 as a "working".
Re:jQuery.payment by zaidf on Thursday February 07, 2013 @03:57PM (#5184454)
So what do you suggest "113" should be interpreted as?
Re:jQuery.payment by sethist on Thursday February 07, 2013 @07:52PM (#5185586)
There are three ways to interpret it. It is either 11/3, 1/13, or an error. Since 11/3 isn't a valid date, I think it is safe to rule that out as an incorrect interpretation. Either of the other two interpretations seem acceptable to me.
Re:jQuery.payment by aiiane on Thursday February 07, 2013 @08:32PM (#5185743)
Er, since when is 11/3 not a valid date?
Re:jQuery.payment by tracker1 on Friday February 08, 2013 @12:16AM (#5186421)
Not for a credit card expiration date...
Re:jQuery.payment by dasil003 on Friday February 08, 2013 @05:08AM (#5187111)
How would you type in 11/30 if it blurts out a big error the moment you type 113?
Re:jQuery.payment by sethist on Friday February 08, 2013 @11:47AM (#5188731)
The same way the system allows you to type in 0213 without blurting out a big error the moment you type 02. Just don't validate the input while the user is still inputting it.

Secondly, remember this is for credit card expirations and not normal dates. You can probably make an assumption that 11/30 (November 2030) isn't currently valid input either. I have never seen an expiration date further than 10 years in the future. Although more research on the topic would be needed to figure out the true restrictions.

Re:jQuery.payment by dasil003 on Friday February 08, 2013 @03:23PM (#5189889)
I don't know why the live demo is broken, or why they even need is since there is a live demo on the main page, but the usability for all cases strikes me as exceptional on the main page where it works as intended. I am not convinced that your cherry-picked restriction improves the usability.
Re:jQuery.payment by Skywing on Thursday February 07, 2013 @04:27PM (#5184589)
I think he's suggesting that 113 should be interpreted as 1/13. I'm not sure how simple that logic would be to implement, though.
Re:jQuery.payment by alttab on Thursday February 07, 2013 @06:19PM (#5185179)
113 is ambiguous. Its an error
Re:jQuery.payment by cpeterso on Thursday February 07, 2013 @05:31PM (#5184958)
The example page on github has an "Expiry formatting" field that says it expects "MM/YY", but it does not allow a '/' character to be entered:

http://stripe.github.com/jquery.payment/example/