News for hackers. Stuff that matters.
Re:HTML Form Validation is heavily underused by Latty on Monday October 28, 2024 @07:44PM (#41977801)
Couldn't disagree more. Browser features can be much better at handling edge cases: disability, localisation, unusual devices, different input methods, weird screen sizes, etc... rather than hoping every developer does it right, building that in is more efficient and consistent. The common cases should be handled really well by browsers.
Re:HTML Form Validation is heavily underused by wvenable on Monday October 28, 2024 @07:53PM (#41977867)
I couldn't disagree more; it might be good for disability but for localization, unusual devices, different input methods, weird screen sizes I have never seen that well executed by browsers. I almost always prefer a more full-featured alternative from a standard framework than whatever is lowest-common-denominator feature in a browser -- which also, depending on the browser, may or may not work the same or may or may not even exist.

The browser should provide low-level capabilities and let developers build the high-level functionality from it.

This article ultimately supports this by showing us exactly how half-baked this particular browser feature happens to be.

Re:HTML Form Validation is heavily underused by JoshTriplett on Monday October 28, 2024 @08:14PM (#41978020)
Browser functionality is typically (handwaving on exact numbers here) better than the worst 80% of sites, on par with the next 10%, and not as good as the top 10%. If you're putting in the effort to build a site in the top 10%, sure, you might not want to be "held back" by the browser. But the vast majority of sites would do better by using what's built into the browser.

And I would argue that the value the user receives from that top 10% of sites is not commensurate with the pain the user receives from the sites that think they're in the top 10% but aren't.

Re:HTML Form Validation is heavily underused by wvenable on Monday October 28, 2024 @08:26PM (#41978120)
I don't know, what browser functionality are we talking about? Even this form validation has to be implemented; I don't think I've ever even seen it in the wild.

What percentage of websites are rolling their own functionality instead of using any one of the various library and framework that do this better?

There is no way that every single browser is going to implement some high-level feature in a satisfactory and future-proof. It's the wrong place to do it. Almost every attempt has been at least a partial failure. We might get something maybe a decade after it's in common use and then only the most basic version of that. And we get browser bloat for our troubles too.

I don't use the standard <select> controls in apps anymore because the build-in version is too simplistic. Don't even get me started on file uploads. Is everyone just supposed to be held-back by the minimum a browser can do everywhere? Why waste browser developers time building things that no one really wants to use.

Re:HTML Form Validation is heavily underused by ryandrake on Monday October 28, 2024 @09:03PM (#41978305)
As a user, I want common UI controls to look and behave the same way across all web sites. Ideally, across all applications on my OS, but that's also a lost cause. POLA[1]. I can accept if the developer wants to somehow extend an existing control to support something new, but it's so irritating when they just re-implement their own thing entirely because they think their ideas are better than the browser's. Multiply that mentality by every site out there, and you have the web as it is today: Everyone's site looks and feels inconsistent with every other site. And everyone ships a different 500 lines of code, each with different bugs, just to implement a drop-down box.

1: https://en.wikipedia.org/wiki/Principle_of_least_astonishmen...

Re:HTML Form Validation is heavily underused by indymike on Tuesday October 29, 2024 @12:08AM (#41979286)
> As a user, I want common UI controls to look and behave the same way across all web sites.

That ship has sailed. (and I wish it had not)

> Everyone's site looks and feels inconsistent with every other site.

Somehow, this model won. Most people muddle through and figure it all out...

Re:HTML Form Validation is heavily underused by wvenable on Monday October 28, 2024 @09:43PM (#41978539)
This is one of these things that sounds perfectly logical -- you want all UI components to look and behave the same across all applications and all websites -- but that is more theoretical than practical.

If you built an app that used just what the browser gives you and nothing more, you're leaving so much functionality on the floor. Having more expressive power often makes things simpler -- using more complex UI controls has allowed me to eliminate whole pages from my application. Users are happier and more productive.

Browser UI implementations can't do one thing that is vital: compete.

Re:HTML Form Validation is heavily underused by CRConrad on Saturday November 09, 2024 @11:11AM (#42095146)
> If you built an app that used just what the browser gives you and nothing more, you're leaving so much functionality on the floor.

Yeah, please do. Because 99.72% of that "functionality" is used to implement crappy ugly bullshit.

Re:HTML Form Validation is heavily underused by ozim on Tuesday October 29, 2024 @09:45AM (#41983788)
With this kind of take - why do we need different applications at all?

UX/UI is solved just use spreadsheet grid, you can do everything in spreadsheet and you will have exactly the same interface/way of doing things.

It is not a joke - I personally have like 80% of things in a spreadsheet (don't get me started what kind of spreadsheet abuse I have seen in my career). But I do understand that lots of stuff can be done much more efficiently with tailored controls and not everything is couple of drop-downs/text boxes.

Re:HTML Form Validation is heavily underused by JoshTriplett on Monday October 28, 2024 @08:58PM (#41978277)
Form validation, form elements, search... I've seen far too many sites try to reinvent a browser textarea or edit box, and fail at very basic things because they didn't handle anything they didn't personally think of. (Some common examples: some of the keyboard controls, or correct handling of scrolling when having enough text in the box to scroll, or the interaction between textarea scrolling and page scrolling...)

"satisfactory" is exactly what browsers tend to provide, with a side order of "no surprises". Designers reinvent browser functionality on a theory of "I don't want satisfactory, I want delightful and unique", and sometimes they succeed, but often they fail. As a user, I very rarely want "unique" when it comes to design.

You don't have to be held back by browsers, and you may well be able to do better, but many people who think they can do better end up doing worse.

Re:HTML Form Validation is heavily underused by wvenable on Monday October 28, 2024 @09:51PM (#41978574)
I don't see what difference it makes whether you use some component built into the browser or some component built on top of the browser.

This article already starts out with how many ways you can screw up this built in browser feature. I bet you didn't even notice that the article examples were slightly broken. The "fix" shows the error when you press submit but doesn't highlight the field in red like if you backspaced it to empty. This is something my validation code does automatically and correctly.

Re:HTML Form Validation is heavily underused by NoGravitas on Tuesday October 29, 2024 @11:14AM (#41984684)
> I don't see what difference it makes whether you use some component built into the browser or some component built on top of the browser.

And this is why you fail. When you use components built into the browser, everyone gets to benefit from the same years of experience and testing, so that edge cases you have never thought about are handled correctly. Websites that re-implement text boxes, history, scrolling, so many things, never get every detail right. They always break on cases the built-in equivalent would handle correctly. Sometimes weird edge-cases, but pretty often completely normal cases that don't appear on the developer's development machine.

Re:HTML Form Validation is heavily underused by wvenable on Tuesday October 29, 2024 @11:39AM (#41985166)
> Websites that re-implement text boxes, history, scrolling, so many things, never get every detail right.

As browsers continue to give developers more low-level control, the less of a problem this is. Take one of your examples, history. This used to be a high-level feature implemented only by the browser and if you built an SPA your users either had a very bad experience or you had get "clever" with various tricks. Now, we have a nice history API.

You say that everyone benefits from the same years of experience and testing but at the same time they're limited to a single vendor. A single idea of how it should work. And a single implementation. Right now if I don't like how validation works/looks that is implemented in JavaScript, I can choose any number of alternatives or implement my own ideas.

The browser should help developers build the best possible solutions, it should not implement those solutions itself.

Browsers themselves have always had weird edge-cases and as a web developer I've always had to work around them (see this article). Sometimes even depending on the browser. The whole idea of an "SPA" was never even imagined by browser makers but developers made that happen.

Re:HTML Form Validation is heavily underused by NoGravitas on Tuesday October 29, 2024 @01:33PM (#41987158)
> As browsers continue to give developers more low-level control, the less of a problem this is. Take one of your examples, history. This used to be a high-level feature implemented only by the browser and if you built an SPA your users either had a very bad experience or you had get "clever" with various tricks. Now, we have a nice history API.

Quite the opposite, in my experience! As browsers give developers more low-level control, they're more tempted to build half-assed replacements for built-in functionality.

The history API - it's good it exists, mainly because it gives SPA developers a way to solve one of the many intrinsic flaws in the SPA design. On the other hand, it's subject to ridiculous kinds of abuse (stuffing history to make it appear to users that the back button doesn't work), or getting out of sync (because web developers can't manage a stack) and making history unusable.

> The whole idea of an "SPA" was never even imagined by browser makers but developers made that happen.

Yes, with generally terrible results, which could have been avoided if browsers hadn't stagnated.

Re:HTML Form Validation is heavily underused by wvenable on Tuesday October 29, 2024 @03:21PM (#41988346)
> Yes, with generally terrible results,

Really? This is like complaining about movies that use computer effects -- you only complain when you can see it. When it's seamless, and often it is, you don't even notice or care.

Why stop at browser apps? All apps are terrible on all operating systems for the same reasons.

This line of argument is meaningless.

Re:HTML Form Validation is heavily underused by CRConrad on Saturday November 09, 2024 @11:14AM (#42095157)
Yes, really.
Re:HTML Form Validation is heavily underused by dotancohen on Monday October 28, 2024 @08:47PM (#41978222)

  > There is no way that every single browser is going to implement some high-level feature in a satisfactory and future-proof. It's the wrong place to do it.
There are far more websites than web browsers, and the turnover at the typical web agency is very high. There is no way that every single web dev is going to implement form validation in an accessible, secure, and his-webdev-replacement-proof way across all browsers and devices.
Re:HTML Form Validation is heavily underused by everdimension on Tuesday October 29, 2024 @10:53AM (#41984438)
> This article ultimately supports this by showing us exactly how half-baked this particular browser feature happens to be.

In a way, yes. I do think there's a lot to improve from the browsers' side. I guess what I'm trying to say is that the "half baked" solution is also not quite as bad as "no solution" and 1) it can be improved, 2) it really can be used today if you know "how to cook it right"

Re:HTML Form Validation is heavily underused by wvenable on Tuesday October 29, 2024 @11:28AM (#41984878)
You say "no solution" like form validation isn't one of the most common things that all web forms do today. Solutions exist. What I'm trying to say is instead of browser building adding high-level functionality like this they should simple continue to provide better ways for us to do it ourselves.

If you code for Windows or Mac OS, you get standard controls, and they do come with a lot of functionality, but ultimately it's still just building blocks for you to build your own functionality. That's what browsers should provide -- low level building blocks.