(no title)
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]