News for hackers. Stuff that matters.
Re:Just Use HTML by graemep on Tuesday September 16, 2025 @09:40AM (#45262128)
You can use JS to provide validation and still submit the form from HTML.
Re:Just Use HTML by skydhash on Tuesday September 16, 2025 @10:17AM (#45262573)
That’s not validation. It’s more like helpful hints.
Re:Just Use HTML by fkyoureadthedoc on Tuesday September 16, 2025 @10:20AM (#45262605)
A pointless distinction when we all know what we're talking about.
Re:Just Use HTML by skydhash on Tuesday September 16, 2025 @10:23AM (#45262648)
Is it? I’ve seen devs bring complicated code to the frontend when a required attribute on the tag would have done the job just as well. Preventing user mistakes is not the same as ensuring correct input.
Re:Just Use HTML by fkyoureadthedoc on Tuesday September 16, 2025 @10:30AM (#45262760)
We've all seen bad implementations of any given thing I'd imagine. Ever submit a form that triggers a full page refresh after about 8 seconds of hanging, only to lose half the data and reveal some arcane requirement to you that wasn't stated up front? Of course this isn't the proper way to do it, but it happens.
Re:Just Use HTML by graemep on Tuesday September 16, 2025 @10:39AM (#45262899)
What is the difference?

The same is true for any JS "validation" and I was using common terminology.

From a user point of view as long as you keep the feedback loop short what difference can they see?

Re:Just Use HTML by cenamus on Tuesday September 16, 2025 @10:24AM (#45262662)
Neither is it validation when you use JS if the server doesn't check it. You can always send requests with postman, curl or your tool of choice.
Re:Just Use HTML by naasking on Tuesday September 16, 2025 @10:26AM (#45262692)
Helpful hints are all you can rely on from client-side. Client-side validation doesn't really exist, true validation only happens server-side.