Live data from Hacker News

HTML Form Validation is underused

expressionstatement.com

91–100 of 343 posts

Re: HTML Form Validation is underused

#91
post #23

I do get the point of using form validation clientside to ensure a better ui. But dont remenber to also verify serverside. Anything clientside can have been fumbeled with. (Also kinda anoying to have to duplicate this tho)

Flask-WTForms will generate the same validation both client and server-side. Is that not usual?

Re: HTML Form Validation is underused

#92

Html form validation is great. There's just one gigantic catch: It doesn't work in Firefox for Android. https://bugzilla.mozilla.org/show_bug.cgi?id=1510450

Firefox for Android has a smaller user base than Samsung Internet and Opera. It's 0.5%. It's a waste of time working on supporting it. Especially considering how little time people put into making sure their sites work for people using accessibility software. I don't think it's worth mentioning in these issues unless you're also ready to talk about UC Browser.

Yay, I'm in the point five percent!

Re: HTML Form Validation is underused

#93

Earlier quoted context omitted.

> these arrow buttons A spinner control, that is. Spinners always puzzled me, to be honest. There is obviously a need for a compact numeric input control that both displays the exact value and allows rough changes using the mouse. Witness knobs in DAWs—which don’t actually work the way you’d expect from their appearance, you’re supposed to grab and then drag in a linear fashion, possibly ending outside the knob’s scr…

> Spinners are obvious, but they are also needlessly fiddly to use with the mouse I think that a quick improvement would be to let the mouse wheel "spin" the number up/down when the input element is focused. An even better improvement would be having the ` ` element actually display the value as it changed, and allow the user to set that value directly (say, by typing it in). Right now, range is useless because the u…

> I think that a quick improvement would be to let the mouse wheel "spin" the number up/down when the input element is focused.

Firefox did that for number inputs for a long time, until very recently. They switched it off in Firefox 130 because people kept inadvertently changing values in forms while scrolling through them [0]. Personally, I've set the about:config option to reenable it since I've found it useful in certain interfaces, though I can't imagine it's much longer for this world.

[0] https://bugzilla.mozilla.org/show_bug.cgi?id=1741469

Re: HTML Form Validation is underused

#94
post #42

It's also easily misused. Take the regular expression validator for passwords on the California DMV website, for example. The website states "Must include at least 4 alpha characters". But the validation pattern ^(?=(.*[a-zA-Z]){4,})(?=.*[0-9!#$%]).+$ requires that these characters appear consecutively .

The {4} is being applied to the whole group which includes a .* Isn't that correct?

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

Re: HTML Form Validation is underused

#97
post #4

That's nice, I'll use that next time. Although it always feels kind of bad to write client side validation code because you're going to have to do the same checks on the server side anyway.

Why is that bad? Both have uses: 1. Client-side validation is for immediate feedback for the user. 2. Server-side validation is to block malicious actors

Re: HTML Form Validation is underused

#98

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:

The confusion in the article is so complete that I'm left wondering whether or not the author is aware that what they are writing is not, in fact, HTML.

Re: HTML Form Validation is underused

#99

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…

[deleted]

Re: HTML Form Validation is underused

#100

My personal bête noire is sites that misuse type=password for 2FA inputs, since that confuses password managers and browsers both.

There is a way to annotate it. autocomplete=one-time-code

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes...

Post reply on HN