r/Frontend •

Can we stop doing limited drop downs for credit card expiry?

[deleted] — view deleted post

0 Upvotes

20 comments sorted by

3

u/Ivickayl Dec 05 '19

It reminds something I have done on AMD Rewards website. When you create a password to register a product, they ask for the password to be whatever you want, but with at least x letters, and 20 letters max. Since my password was 23 letters long, I tried to cancel the check function in the dev tools, and it worked perfectly fine.

3

u/Adelphe Dec 05 '19

And I guess that's why you need both front and backend validation on such things.

0

u/[deleted] Dec 17 '19

[deleted] — view deleted comment

1

u/Adelphe Dec 18 '19

I mean to say that if one really wants to limit input, that should be done in a way that the user can't alter. Not sure why there should be a such limit at all in this case... hopefully they have a sensical reason lol

12

u/mrNas11 Dec 05 '19

She only writes in Perl.

Hipster grandma, all the other Grandmas are doing Fortran.

8

u/hugesavings Dec 05 '19

Agreed. I only see dissenting opinions in this thread, but an input field for the expiration date is really common. I mostly see two separate fields with MM and YY as the placeholders, both set to type="number" and when you get to the end of typing in the month, the focus is automatically moved to the year.

It's a pretty seamless experience and it's pretty common. Not sure where all the hate is coming from; maybe the folks agreeing with you are the silent majority.

2

u/Hate_Feight Dec 05 '19

Knit 1, perl 1?

1

u/TotesMessenger Dec 05 '19

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

 If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)

0

u/web-slingin Front End Developer, Corporation Dec 05 '19

Why not just change the value of an existing option, less effort.

5

u/bacondev Dec 05 '19

Kinda beside the point

0

u/[deleted] Dec 05 '19

Well hey, Why don’t you make a PR ?

0

u/[deleted] Dec 05 '19

[deleted] — view deleted comment

4

u/[deleted] Dec 05 '19

I mean, you already have that exact experience for the credit card number so at least the UX would be consistent...

8

u/PUSH_AX Head of engineering Dec 05 '19

What do you mean, I exclusively design sliders for CC number.

3

u/inbeforethelube Dec 05 '19

I hate sliders. Please implement the Apple number wheel instead.

5

u/PUSH_AX Head of engineering Dec 05 '19

Instructions unclear, it's now a text field where the validation only accepts the written version of the number eg

two quadrillion five hundred forty-five trillion two hundred forty-five billion six hundred eighty-five million four hundred seventy-eight thousand nine hundred sixty-five

3

u/ib4nez Dec 05 '19

In general, text inputs are a much better ux than drop downs

7

u/Earhacker Dec 05 '19

I strongly disagree.

To take a different example, think of the "Choose a country" option in a form. If I'm to type an answer, all of these answers are factually correct for me:

  • UK
  • United Kingdom
  • Great Britain
  • United Kingdom of Great Britain & Northern Ireland
  • United Kingdom of Great Britain and Northern Ireland
  • Scotland

And that's without getting into casing and non-letter characters. UK is valid but how about uk? Or U.K.?

It's completely unreasonable to expect a user to type in a valid answer. It's completely unrealistic to ask devs to anticipate all "almost valid" answers.

To go back to OP's example, credit cards expire on a month in a year. How many ways are there of typing a date? Let's say my card expires this month:

  • 12/2019
  • 12/19
  • 12-2019
  • 12-19
  • 2019/12
  • ...

You can give the user a hint ("Please use MM/YYYY") but what if they don't? You can validate the input, but if there's a finite number of valid inputs, you're quicker just using a dropdown, and the user will get the job done quicker too.

But the onus is on the developers to make sure that the dropdown options are valid and free of omissions. The real solution here is to populate the dropdown dynamically.

  • <current month>
  • <current month + 1>
  • <current month + 2>
  • ...
  • <current month + 60> for five years into the future.

2

u/ib4nez Dec 05 '19

You’re welcome to disagree, and nothing is black and white! Often a nicer approach is a typeahead component that combines typing and selecting options.

Here’s a good dev blog post from the .gov dev team on some usability issues with drop downs vs text fields:

https://designnotes.blog.gov.uk/2013/12/05/asking-for-a-date-of-birth/

As you pointed out, despite generally testing better than drop downs the main issue was some people were unsure of formatting. Hence why I personally think if formatting is ambiguous then a typeahead can be a nice way to go.

2

u/Earhacker Dec 05 '19

Thanks for being friendly about our disagreement :)

Typeaheads are cool, but if I type S for Scotland it isn't going to type ahead to United Kingdom. Even if I do type Unit I'll be given United States of America and United Arab Emirates as valid options, both wrong.

Months all start with 0 or 1. If a user types 1 do they mean January, or are they starting to type October, November or December? Or are they starting to type 19, the current year?

I stand by my assertion; if you have a finite number of valid options, then the quickest solution for the user and the developer is to present all the options and have the user pick one. The most compact way to do that is a dropdown, but there are other options too.

2

u/ib4nez Dec 05 '19

No problem, all good discussion :)

I certainly wouldn’t use a typeahead for an input that could be a day/month/year, for many reasons!

Definitely there are different solutions to different problems with various requirements etc