Live data from Hacker News

HTML Form Validation is underused

expressionstatement.com

201–210 of 343 posts

Re: HTML Form Validation is underused

#201

Earlier quoted context omitted.

True, but vast majority of websites don't do the right thing. So password managers need to manage a database of form input overrides. I worked at a small company building a password manager and it was a bit of a nightmare, we had to allocate support staff resources to handling reports of website incompatibilities.

I'm curious, why did you implement your own password manager?

I worked for a small company that did. The idea was the password manager lived only on your phone, and you'd connect it to your computer in various ways. Notably including our own hardware, USB nub that connected to the phone app via Bluetooth and acted as a keyboard for the device and the app would instruct it to do the keystrokes to enter your saved credentials. Also a browser extension that the app would connect to over websockets (through our relay servers, DH key exchange to encrypt the connection end to end) and the extension would request the app to send down the credentials on demand. Also we were a very early adopter/implementor of FIDO U2F (security keys). The product kinda hinged on the paranoia of the userbase (which I never aligned with, I trust 1Password and cloud sync'd encrypted vaults for example) so it never really took off. It wasn't "my" product, but I worked on it for a few years, right out of school.

Re: HTML Form Validation is underused

#202
post #198

Last time I checked, web-browsers today still do not allow you to style the appearance of built-in HTML validation messages [1]; this wouldn't be so bad if Chrome (and Firefox) still conformed to their OS platform UI guidelines (i.e. so it looks system-generated, like how `title=""` tooltips used to be), instead Chrome uses this ugly yellow/orange icon color with black-text on a white background on a bubble with a fi…

I never really understood why people want to style stuff like this. I like how you can express yourself by using colors and layout and stuff like that. But at some point usability is more important than branding.

> usability is more important than branding.

Said no designer ever.

At work our design team came up with buttons that are 10x10 pixels on my screen. They are used to change pages (like on mobile, but this is a desktop program), the scroll events are ignored by design, so you either click the tiny buttons (which are slightly darker gray than the dark background) or you simulate a finger swipe via drag and drop with the mouse. Yes they designed a touch GUI for a desktop application.

Re: HTML Form Validation is underused

#203

Earlier quoted context omitted.

But what's crazy is both of those still don't disallow non-numeric input unless you use JS to reject keystrokes and intercept paste. HTML form validation is so incomplete and limited, every time I look at it I want to scream cause wtf there's so many just totally obvious things we need that don't exist by default and we need to reinvent the wheel. Native date and time inputs are still garbage so every UI framework ha…

You shouldn't reject keystrokes as that can lead to silent errors when the user thinks they entered something that was not allowed. And final validation needs to happen on the server side anyway - anything before that is just a usability helper.

exactly. Silently refusing input is an anti-pattern

Re: HTML Form Validation is underused

#204
post #198

Last time I checked, web-browsers today still do not allow you to style the appearance of built-in HTML validation messages [1]; this wouldn't be so bad if Chrome (and Firefox) still conformed to their OS platform UI guidelines (i.e. so it looks system-generated, like how `title=""` tooltips used to be), instead Chrome uses this ugly yellow/orange icon color with black-text on a white background on a bubble with a fi…

I never really understood why people want to style stuff like this. I like how you can express yourself by using colors and layout and stuff like that. But at some point usability is more important than branding.

But at some point usability is more important than branding.

I have never worked for any company or organisation that believed this. Most clients will send you their branding guidelines before sending their feature requests. If they get to choose between adding a new feature, improving usability or making sure everything follows the branding, they will choose the branding every time.

Re: HTML Form Validation is underused

#205
post #94

Earlier quoted context omitted.

Yep, and the .* means "0 or more of anything", so it's 4 or more groups that each end with a letter. They can be consecutive or not and a group can be a single letter but doesn't need to be - so whatever the failure was, it wasn't that (or the regex was typo'd here to be correct instead of what was actually on the site).

The regexp still requires four letters before the last digit or special character which is a weird requirement.

The (?=…) are "lookaheads". They match the enclosed pattern without advancing the cursor.

Re: HTML Form Validation is underused

#206
post #177

Earlier quoted context omitted.

I’ve read some very user hostile things in my career, but this one is particularly acerbic. It’s a bad look. If I ever grew to hate users this much, I would find a new career. You should consider that.

I'm not being user hostile. I'm being cognizant that the skill levels of users is extremely wide, and to best serve everyone from a UX standpoint, it's best to limit the characters accepted in the input. It protects the user, helps them avoid mistakes.

From reading your comments, you're extremely user hostile and I hope to not come across anything you work on because they are the very definition of antipatterns

Re: HTML Form Validation is underused

#207

Earlier quoted context omitted.

True. But you can hide the default message and replace it with your own. You'll still benefit from the form validation.

There is no real benefit because the validation rules allowed there are often too limited for real use-cases anyway.

Do you have any examples?

Re: HTML Form Validation is underused

#208

It's a bit disappointing that articles talking about HTML use JSX/React syntax instead of actual HTML (even more so not actually saying it). Example from the article:

It's exacerbated by the fact that the API they propose to make custom validation more ergonomic works for React, but would be much worse for plain Javascript and HTML.

Re: HTML Form Validation is underused

#209
post #206

Earlier quoted context omitted.

I'm not being user hostile. I'm being cognizant that the skill levels of users is extremely wide, and to best serve everyone from a UX standpoint, it's best to limit the characters accepted in the input. It protects the user, helps them avoid mistakes.

From reading your comments, you're extremely user hostile and I hope to not come across anything you work on because they are the very definition of antipatterns

It's a decimal number field. There's no reason to have any other characters than [0-9\.-]* You're overreacting. You're attacking me for no reason.

Re: HTML Form Validation is underused

#210

Earlier quoted context omitted.

"Break your UX" is a vast exaggeration. I'm not talking about phone number fields, to be clear. I'm talking about like numeric amounts, with maybe a negative or decimal point. It's literally just [0-9\.-] but that still requires JS to limit inputs to that.

What's wrong with though?

[deleted]
Post reply on HN