(no title)
niux
|
5 months ago
This article is an oversimplification describing basic forms, but as soon as you try to implement any sort of advanced validation using just HTML, the whole paradigm falls apart. Browsers support JavaScript for a reason.
dreadnip|5 months ago
Why not validate on the server and return a response or error as HTML?
I’m not trying to argue in bad faith here. I know client side validation is necessary in some cases, but IMO it’s only an augmentation for UX purposes on top of server side validation.
Tade0|5 months ago
If your form has files you'd want to at least check it before sending data unnecessarily to the server.
Also it's always better to have a tighter feedback loop. That is really the main reason why there's validation on the frontend and backend, not just the latter.
palmfacehn|5 months ago
HTML has come a long way since the bad old days. General constraints can be applied directly to the input element. It still makes sense add additional explanations for the invalid input with JS though.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
prokopton|5 months ago
carlosjobim|5 months ago
It's also essential in order to not make forms to difficult to fill in, because that means you lose customers and a lot of money.
jonkoops|5 months ago
e12e|5 months ago
lezojeda|5 months ago
[deleted]
graemep|5 months ago
skydhash|5 months ago
norman784|5 months ago
leftyspook|5 months ago
port11|5 months ago
You'll need server-side validation anyway…
unknown|5 months ago
[deleted]