Live data from Hacker News

HTML Form Validation is underused

expressionstatement.com

111–120 of 343 posts

Re: HTML Form Validation is underused

#111
post #22

In an all honest reply, is that the people that writes these specifications, live disconnected from the reality, they don't use the stuff they specify. That stuff works for very simple things, but then when your forms evolve you realise you will be better off just writing the whole thing yourself.

This. Doing relatively common things like cross-referencing from other fields ("did the user specify a country? If so, we can validate the postcode/zip code they just entered, but if not we'll have to wait until they pick a country") almost immediately require JS to handle, and as soon as you're using JS then it's all just easier to do in code than trying to mess around with validation properties.

Re: HTML Form Validation is underused

#112

Earlier quoted context omitted.

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.

Is that somewhat biased? - I assume the number of people using Firefox has a quite big overlap with people using ad&tracking blockers, which block many statistic sites. (Website operators may log user agent which will be somewhat accurate still)

This is always something I question whenever the analytics numbers come out. I know my adblocker blocks GA, so I'm not going to be included in any GA statistics.

Every time I've asked a marketing person about this they get hand-wavy about "it all comes out in the wash". But meanwhile they say things like "our analytics show that our market is mostly older and non-tech-savvy people". I'm not sure that the analytics numbers do actually show that. I think that's just the demographic that you can see.

Re: HTML Form Validation is underused

#113
post #106

Earlier quoted context omitted.

Yep. This is great until you need a cross-browser date picker, at which point you need to implement a bunch of stuff yourself. It’s frustrating how primitive HTML forms are, after so many years.

What do you mean? Most browsers support natively just fine.

> What do you mean? Most browsers support natively just fine.

The `` on FF has a broken time-picker[1], has always been broken, and there are no plans to ever fix it, ever.

[1] In that it will let you pick a date, but not a time - the time must be manually typed into the input!

Re: HTML Form Validation is underused

#114

If you have a checkbox with a label, please a "for" attribute to the label so I can disable/enable the checkbox by clicking the label. This is one of my biggest pet peeves, maybe its just me.

Wrapping input into a label also works. Not sure why people tend to separate the two.

And also why browsers started separting these. It’s a checkbox and radio that should contain a text, not vice versa.

Re: HTML Form Validation is underused

#115
post #31
post #11

The biggest, easiest to implement underutilization is: "Using specific type attribute values, such as "email", "number", or "url"" These can significantly improve user experience on mobile by triggering the optimal keyboard.

I avoid the use of `type=number` and use `type=text inputmode=numeric` instead. It doesn't come with these arrow buttons which most users don't need anyway for entering numbers. Also the keyboard is better on iOS.

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 has to build their own solution.

Re: HTML Form Validation is underused

#117
post #116

The best native HTML validation is server-side validation. The only downside: the user has to wait 300ms.

And he loses his page state if there is an error. You have to do server-side validation regardless, but client-side validation can be a lot more pleasant for the user.

I used to think it doubled your workload to do both, but if you are using JS-free client-side validation, I think that the server can just return an HTTP error guilt-free for any invalid input that the browser will catch. It’s a pretty good compromise for format validation.

Re: HTML Form Validation is underused

#118
post #106

Earlier quoted context omitted.

Yep. This is great until you need a cross-browser date picker, at which point you need to implement a bunch of stuff yourself. It’s frustrating how primitive HTML forms are, after so many years.

What do you mean? Most browsers support natively just fine.

On Android, the date picker widget is fiddly to use for selecting distant dates, like date of birth. Not impossible but requires many many taps.

Re: HTML Form Validation is underused

#119
post #116

The best native HTML validation is server-side validation. The only downside: the user has to wait 300ms.

And he loses his page state if there is an error. You have to do server-side validation regardless, but client-side validation can be a lot more pleasant for the user. I used to think it doubled your workload to do both, but if you are using JS-free client-side validation, I think that the server can just return an HTTP error guilt-free for any invalid input that the browser will catch. It’s a pretty good compromise…

When returning an error, you can fill the input values in your HTML response.

Indeed the most pleasant UX is to set an additional validation logic on the client side and I don’t think this should the go-to solution.

Re: HTML Form Validation is underused

#120
post #114

If you have a checkbox with a label, please a "for" attribute to the label so I can disable/enable the checkbox by clicking the label. This is one of my biggest pet peeves, maybe its just me.

Wrapping input into a label also works. Not sure why people tend to separate the two. And also why browsers started separting these. It’s a checkbox and radio that should contain a text, not vice versa.

One reason I have heard about is implicit labelling doesn't work with all voice control tech, including macOS voice control[1]

[1] https://a11ysupport.io/tests/html_label_element_implicit

Post reply on HN