News for hackers. Stuff that matters.
Re:Why the Gov.uk Design System team changed the input type ... by downerending on Thursday February 27, 2020 @01:12PM (#22435959)
One good reason for this is that for things like credit card numbers, a good interface will accept leading, trailing, or interior spaces. Sites that make me type in values in exactly their own weird format are an abomination.

Site A: Ah ah ah! You put a slash in your date! No soup for you!

Site B: Ah ah ah! You didn't put a slash in your date! No soup for you!

Re:Why the Gov.uk Design System team changed the input type ... by dmix on Thursday February 27, 2020 @02:02PM (#22436583)
That's one of the reasons I love Stripe's checkout being used everywhere and designers elsewhere basically copying them.

The internet is constantly getting better and I don't think we give that progress we've made in web design over the last few decades enough credit.

Just imagine how bad it used to be to just purchase a simple thing on an ecommerce site in the mid 2000s. Or remember what car websites used to look like vs what they look like now. Even newspaper websites like NYT are leaders with quality design.

It's easy to complain about those who still don't get it, but I feel like we've also made massive progress from the early wild-west days of the internet.

Still, I'm all for shaming those sites who still make inserting credit card numbers a pain in the ass.

Re:Why the Gov.uk Design System team changed the input type ... by BrianB on Thursday February 27, 2020 @04:25PM (#22438104)
> Or remember what car websites used to look like vs what they look like now.

lingscars.com ?

Re:Why the Gov.uk Design System team changed the input type ... by black_puppydog on Thursday February 27, 2020 @06:15PM (#22439003)
> Made in the People's Republic of China (me, not the website... which was handcrafted by Ling, in the UK)

That's some real artisanal HTML right there. <3

Re:Why the Gov.uk Design System team changed the input type ... by frob on Thursday February 27, 2020 @05:14PM (#22438530)
This might be the best website ever. It is over the top, but the theme is consistent. It reminds me of a myspace page, but if someone just wanted to be ridiculous, not unsightly.

Side note: anyone remember "I knows me some ugly myspace" from Ze Frank?

Re:Why the Gov.uk Design System team changed the input type ... by aspenmayer on Thursday February 27, 2020 @07:56PM (#22439625)
Ze Frank. Now there’s a name I haven’t heard in quite some time. What an early internet vlog pioneer. I wondered what happened to him and looked him up a while back. Turns out he’s some bigwig at BuzzFeed so I guess he made out okay, but part of me misses that early enthusiasm and wonder of early internet 2.0.
Re:Why the Gov.uk Design System team changed the input type ... by zimpenfish on Friday February 28, 2020 @08:00AM (#22442450)
He's recently restarted posting to his YouTube channel and they're definitely worth a watch.
Re:Why the Gov.uk Design System team changed the input type ... by kwhitefoot on Friday February 28, 2020 @07:36AM (#22442339)
Brilliant. I almost wish I needed to lease a car just so I could put some business her way.
Re:Why the Gov.uk Design System team changed the input type ... by admax88q on Thursday February 27, 2020 @05:02PM (#22438438)
This site is amazing.
Re:Why the Gov.uk Design System team changed the input type ... by roel_v on Thursday February 27, 2020 @06:47PM (#22439213)
I love this website. Can anyone from the UK explain what a 'mutti-car' is?
Re:Why the Gov.uk Design System team changed the input type ... by smcl on Friday February 28, 2020 @12:43AM (#22440782)
If it helps, I’m from the UK and I have no idea
Re:Why the Gov.uk Design System team changed the input type ... by JensRex on Friday February 28, 2020 @03:14AM (#22441306)
The only way that makes sense to me, is that "mutti" is a short form of "mutter" in german, which means mother. So a "mom car".

Disclaimer: I'm not english, and only half german.

Re:Why the Gov.uk Design System team changed the input type ... by OJFord on Thursday February 27, 2020 @07:49PM (#22439580)
No more than I can explain 'electrodreams' or 'mackem sex', I'm afraid!
Re:Why the Gov.uk Design System team changed the input type ... by monadgonad on Friday February 28, 2020 @03:21AM (#22441330)
A mackem is someone from Sunderland.
Re:Why the Gov.uk Design System team changed the input type ... by radiowave on Friday February 28, 2020 @04:53AM (#22441684)
And Sunderland is where the Nissan Qashqai is manufactured.
Re:Why the Gov.uk Design System team changed the input type ... by BrianB on Thursday February 27, 2020 @05:21PM (#22438585)
Did you check the source code yet?
Re:Why the Gov.uk Design System team changed the input type ... by Rudisimo on Monday March 02, 2020 @09:27PM (#22471285)
That's a glorious Ling ASCII banner. But the video referenced in the commented YouTubePlayer widget is a first for me, and absolutely hilarious: [Drugos (Despacito) LINGsCARS website promo][1]

[1]: https://youtu.be/L2GlWaeNNoU

Re:Why the Gov.uk Design System team changed the input type ... by randomdude402 on Friday February 28, 2020 @01:27AM (#22440920)
It's interesting to see how many people take certain things in web design for granted. I'd be interested to know how many readers here were in the neighborhood of 10 or 12 years old in the mid 2000s.

We've reached a point where it seems like the amount of people who know react looks pretty close to the amount of people who know CSS. CSS wasn't even a thing when I built my first site, and now the phrase "web design" isn't even really in the vernacular today.

I'm not asking anybody to get off my lawn or anything, it's just interesting.

Re:Why the Gov.uk Design System team changed the input type ... by DonHopkins on Thursday February 27, 2020 @04:31PM (#22438159)
I hate it when they have drop-down menu for entering your year of birth, so the older you are, the further you have to scroll, but only infants and toddlers can select the year they were born without scrolling.

A non-numeric text field is so much easier, and you should also be able enter your birth year as Roman numerals (which is even easier for millennials).

Re:Why the Gov.uk Design System team changed the input type ... by RandallBrown on Thursday February 27, 2020 @05:07PM (#22438474)
I think you're joking about Roman numerals, but millennials birth years are anything but easy to type in as a Roman numeral. For example, my birth year of 1987 is MCMLXXXVII.
Re:Why the Gov.uk Design System team changed the input type ... by DonHopkins on Thursday February 27, 2020 @05:38PM (#22438737)
Oh that's right, I meant post-millennials, who got a fresh start in MM.
Re:Why the Gov.uk Design System team changed the input type ... by xboxnolifes on Thursday February 27, 2020 @06:51PM (#22439234)
Zoomers
Re:Why the Gov.uk Design System team changed the input type ... by numpad0 on Thursday February 27, 2020 @09:01PM (#22439920)
Can’t you just type “1984” or “Alaska” while focused on the dropdown to select on modern browsers
Re:Why the Gov.uk Design System team changed the input type ... by smcl on Friday February 28, 2020 @12:44AM (#22440784)
Not on mobile
Re:Why the Gov.uk Design System team changed the input type ... by mc3 on Thursday February 27, 2020 @10:05PM (#22440170)
Gen Z are the ones born on MM or later.
Re:Why the Gov.uk Design System team changed the input type ... by 2038AD on Friday February 28, 2020 @04:53AM (#22441686)
Nope! Late 90s get rolled in too. Exact dates depend on who you ask and I'd avoid using generational names altogether.
Re:Why the Gov.uk Design System team changed the input type ... by DonHopkins on Saturday February 29, 2020 @01:59AM (#22449365)
OK, MMer! ;)
Re:Why the Gov.uk Design System team changed the input type ... by mc3 on Sunday March 01, 2020 @11:43PM (#22461732)
I'm closer to MTV than MM
Re:Why the Gov.uk Design System team changed the input type ... by DonHopkins on Monday March 02, 2020 @01:19AM (#22462115)
So OK MMMBopper? ;)
Re:Why the Gov.uk Design System team changed the input type ... by saagarjha on Thursday February 27, 2020 @09:38PM (#22440061)
Trying to change the system because millennials have it slightly easier than you is the most “ok boomer” thing I’ve seen today ;)
Re:Why the Gov.uk Design System team changed the input type ... by airstrike on Thursday February 27, 2020 @01:56PM (#22436503)
> a good interface will accept leading, trailing, or interior spaces

Won't pattern="[0-9]*" do the exact opposite of what you're suggesting?

Re:Why the Gov.uk Design System team changed the input type ... by dmix on Thursday February 27, 2020 @02:09PM (#22436643)
Yes, you're right, this isn't a great solution for credit card inputs either. They should be able handle dashes and other spacing characters and the site should be able to filter/format it automatically either on the front-end before submission or with some server-side processing. And no we don't need four different input boxes to enter a credit card numbers either.

Flexibility is key here and since many websites handle things differently (and since many of the physical cards have literal dashes on them, which they are looking at when inputting the numbers), you should be able to guide your user into the right format without them having to get error messages or other nonsense.

Not enough web designers appreciate the anxiety of having to input a credit card number or other format-varied content into input boxes.

Re:Why the Gov.uk Design System team changed the input type ... by patio11 on Friday February 28, 2020 @05:04AM (#22441734)
A fun edge case, of the million edge cases for credit cards:

If you have Japanese users, their browser/input method editor may send full-width characters by default, such as 4321 instead of 4321. You should probably honor those, but unless you wrote code to do this, you almost certainly won't. Even most Japanese sites are user-hostile here, either failing to detect them as numbers or telling the user "You wrote your number in full-width characters; please try again in half-width characters" despite them being trivially convertable.

(Disclaimer: this is professionally relevant to me and yes, Stripe Elements / Checkout do do the right thing here.)

Re:Why the Gov.uk Design System team changed the input type ... by kevin_thibedeau on Friday February 28, 2020 @11:39AM (#22443999)
For reference by others: You want to apply NFKC or NFKD Unicode normalization to collapse full-width Latin letters and digits to their usual form. This also widens half-width kana.
Re:Why the Gov.uk Design System team changed the input type ... by fallous on Thursday February 27, 2020 @02:48PM (#22437047)
Part of the problem is that inputs don't necessarily reflect the specific intent behind the use of certain symbols. For 99% of people using US keyboards when they input a dash in a credit card number they are using the exact same key as one would use for the minus when inputting a negative number. If you asked them to verbalize their inputs they would probably use different words for the same symbol, signifying that the meaning or intent isn't the same but even that isn't entirely reliable.

You can attempt to infer intent or meaning based on the context of the input field but often the least-problematic method is to provide instruction/hints with the field, examples of correctness, and real-time validation with specific syntax errors when invalid or unexpected data is provided. I'd argue that it would also be worthwhile to request clarity from the user when an input hits a filtering rule so that they can make clear their intent... e.g. if you assume that they're using "-" as a symbol for separation rather than simply follow that assumption, ask if that's the case and list other optional valid contexts for that symbol so they can be explicit. If they choose None of the Above or a context that is inappropriate for the field, inform them of that.

The 4-box credit card form, while pretty terrible in many ways, at least made explicit the expectations. Often we now hide the expectations and either auto-reformat what was put in the field (which can be surprising to the user or worse can modify their input to mean something other than what they intended) or do hidden filtering, which can have the same problems but doesn't even bother to inform the user of the changes.

Re:Why the Gov.uk Design System team changed the input type ... by Dylan16807 on Friday February 28, 2020 @01:11AM (#22440863)
> when they input a dash in a credit card number they are using the exact same key as one would use for the minus when inputting a negative number

So what? I can't imagine any possible way it would be unclear whether someone entered a credit card number or a negative number. They have different numbers of "-" in completely different places. Am I missing something?

> I'd argue that it would also be worthwhile to request clarity from the user when an input hits a filtering rule so that they can make clear their intent... e.g. if you assume that they're using "-" as a symbol for separation rather than simply follow that assumption, ask if that's the case and list other optional valid contexts for that symbol so they can be explicit. If they choose None of the Above or a context that is inappropriate for the field, inform them of that.

That sounds like such bad usability I'd assume you were joking if the rest of your post didn't sound so serious.

Re:Why the Gov.uk Design System team changed the input type ... by fallous on Friday February 28, 2020 @10:12AM (#22443265)
Note that my post isn't limited to credit card inputs, nor do I say that the request for clarity is mandatory in all fields.

What I'm advocating is a focus on ensuring the user's explicit intent rather than attempting to infer intent or making hidden assumptions that either could be wrong or exist to make things easier for the developer.

Too many times I've had to deal with data that someone optimistically sanitized or filtered client-side and then stored, only to discover the sanitizing/filtering rules were wrong and the original data provided by the user was lost because the only thing stored was the result of those rules.

Re:Why the Gov.uk Design System team changed the input type ... by Dylan16807 on Friday February 28, 2020 @04:08PM (#22446376)
> Note that my post isn't limited to credit card inputs

Not your entire post, but the part about the '-' key was pretty specific and narrow-scoped.

> What I'm advocating is a focus on ensuring the user's explicit intent rather than attempting to infer intent or making hidden assumptions that either could be wrong or exist to make things easier for the developer.

'explicit intent' sounds like a nice goal but asking the user inside the form is not going to give you good info, and it will very often annoy them.

> only to discover the sanitizing/filtering rules were wrong and the original data provided by the user was lost because the only thing stored was the result of those rules

It wouldn't hurt to store the original. Even if the user told you what they meant, they might have said the wrong thing.

Re:Why the Gov.uk Design System team changed the input type ... by DonHopkins on Thursday February 27, 2020 @04:34PM (#22438196)
Not to mention that some countries use . as a decimal point and , as a digit grouping separator, and others do it the other way around.
Re:Why the Gov.uk Design System team changed the input type ... by bcrosby95 on Friday February 28, 2020 @02:40AM (#22441184)
Yes, I'm rather glad I haven't had to deal with localizing decimal inputs, just displaying them.

I have had to deal with localizing date inputs though. Ugh.

Re:Why the Gov.uk Design System team changed the input type ... by hibbelig on Friday February 28, 2020 @05:03AM (#22441727)
Why is this "ugh"? The way I see it, we're building software for users, and we try to make it useful for them. And part of that is trying to come up with a pleasing and easy to understand design language. And another part of it is catering to different cultures and languages.

For example, afaik, the standard way Chinese dates are written is something like "2020Y02M28D" but with the Chinese characters (words) for year, month, and day, instead of Y, M D. I find this totally beautiful: it doesn't take up more space than "-" or "/" or "." as a separator, and it totally disambiguates the meaning. (Well, there is the trailing "day", so we are losing one character.). It is such a wonderful use of the fact that Chinese is using ideographic characters. Isn't it?

Re:Why the Gov.uk Design System team changed the input type ... by bcrosby95 on Friday February 28, 2020 @11:23AM (#22443859)
I enjoy creating software users find useful.

But it goes beyond "this is what they do". Users tend to do a wide range of things when entering dates and you kinda have to guess what they mean. Throw in guessing what localization should be used (it's not always clear) on top of that fuzzy system and it can become a frustrating experience for everyone involved.

Re:Why the Gov.uk Design System team changed the input type ... by dzhiurgis on Thursday February 27, 2020 @09:45PM (#22440090)
> Not enough web designers appreciate the anxiety of having to input a credit card number or other format-varied content into input boxes.

I feel most of these things should be solved by browsers, not designers...

Problem is for something like credit card every single browser vendor will try to plug their own service in one way or another (think Apple Pay and Android Pay).

Re:Why the Gov.uk Design System team changed the input type ... by joelanman on Thursday February 27, 2020 @04:59PM (#22438409)
Important to note that in the article we mention we only use pattern to trigger the right keyboard in old iOS. We actually turn off HTML validation in favour of doing server side validation, we'll soon be publishing guidance on that too. Disclaimer - I work on the team.
Re:Why the Gov.uk Design System team changed the input type ... by andreareina on Thursday February 27, 2020 @09:05PM (#22439937)
Why are you going to server-side only? I've always held that client-side validation is important for UX as it provides instant feedback and doesn't need any extra work to preserve the other data that's already been input. Obviously the inputs still need to be validated on the server e.g. to protect against things that get past (or bypass) the client-side checks, or perform more expensive validation.
Re:Why the Gov.uk Design System team changed the input type ... by joelanman on Friday February 28, 2020 @05:05AM (#22441740)
We'll be publishing soon on the GOV.UK Design System, but in summary we can't make browser validation consistent with our Design System, or guarantee it's always accessible.

In our research it's commonly most often helpful to validate when the user submits as that's when you can be sure they're 'done'. There are cases when realtime helps so it's fine to add it in those situations.

Re:Why the Gov.uk Design System team changed the input type ... by OJFord on Thursday February 27, 2020 @07:55PM (#22439615)
Disclosure* - you're claiming to be on the team, not disclaiming it.
Re:Why the Gov.uk Design System team changed the input type ... by OJFord on Thursday February 27, 2020 @07:52PM (#22439596)
It won't accept it.. in exactly the right way.

Because you can't enter spaces, they don't get submitted, and validation doesn't fail.

As long as they don't also do 'class="nopaste"' or whatever, we're golden!

Re:Why the Gov.uk Design System team changed the input type ... by jmiserez on Thursday February 27, 2020 @04:10PM (#22437916)
Also sites that accept a 07/21 expiration date but not 7/21. Even worse if they accept it but then say it's an invalid card.
Re:Why the Gov.uk Design System team changed the input type ... by gwillz on Friday February 28, 2020 @05:11AM (#22441766)
Also, the expiry date should never be a date picker. I'm not trying to _choose_ a date, I'm just dumping the exact numbers from my card. I want to type, tab, type, tab, type, enter, and be done.
Re:Why the Gov.uk Design System team changed the input type ... by mikro2nd on Friday February 28, 2020 @05:18AM (#22441798)
But wait! It gets worse: Date-of-birth fields where they use a date picker, and the default/starting date is today.

I'm a bit older than the average HM demographic, so using a date picker to scroll back many years might take hundreds of clicks. Then I made a mistake (details long forgotten) and the whole thing reset and I had to start again. On the third time around I just quit.

Re:Why the Gov.uk Design System team changed the input type ... by anonsivalley652 on Thursday February 27, 2020 @07:07PM (#22439353)
Exactly. Good control UX should be very liberal in what it accepts and normalize it to whatever form they want. Same goes with editing, it should allow temporary invalidity (extra or fewer digits) turn red/disable submit and then return to green when fixed.

Don't make hundreds to millions of users do extra work that could've been automated with a little more care.

Re:Why the Gov.uk Design System team changed the input type ... by brlewis on Thursday February 27, 2020 @02:33PM (#22436884)
This may not be semantically pure, but I think type="tel" is a simple and ergonomic approach to credit card input. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/in...

EDIT: Also more widely supported than https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att...

Re:Why the Gov.uk Design System team changed the input type ... by Wowfunhappy on Thursday February 27, 2020 @05:11PM (#22438501)
I'm not against weird hacks where necessary, but how is this better than the GP's non-hacky suggestion?

Inputmode isn't supported by most desktop browsers but it doesn't need to be. Every mobile browser save mobile Firefox supports it.

...I wonder what's up with Mobile Firefox?

Re:Why the Gov.uk Design System team changed the input type ... by brlewis on Thursday February 27, 2020 @05:36PM (#22438713)
Using the same markup for desktop and mobile means less code which usually translates to fewer bugs.
Re:Why the Gov.uk Design System team changed the input type ... by Wowfunhappy on Thursday February 27, 2020 @06:34PM (#22439118)
It would be the same markup. It just wouldn't do anything on desktop. Which is fine because desktops generally have physical keyboards.

I apologize if you already know this, but to make sure we're on the same page: what "inputmode" does is tell phones to display the onscreen keyboard as a numpad, instead of a full set of QWERTY letters and numbers. Outside of a few edge-cases, you don't generally need that on desktop.

Re:Why the Gov.uk Design System team changed the input type ... by brlewis on Thursday February 27, 2020 @11:25PM (#22440509)
TBH I went on autopilot looking at MDN's browser compatibility list. Also as a user of Firefox on Android I was interested in something that works there, but type="tel" doesn't behave any better. The only advantage to not using inputmode is getting rid of an HTML validator warning, so you're right.