4 ms·
At the risk of stating the obvious, and sorry if so: doing input length validation client side is very useful for the user's experience, but the server should a
by tomsmeding 6y ago
At the risk of stating the obvious, and sorry if so: doing input length validation client side is very useful for the user's experience, but the server should always validate this too. "... now suddenly I have to revisit everything and add JavaScript magic to check form validity ..." sounds suspiciously like you were relying on client side form validation without server validation, I hope that's not the case. :)
- lucb1e 6y agoIt prevents server-side errors, which I don't handle as gracefully. When the client sends content that it shouldn't have been able to send (i.e. someone tampered with the form) and the server bails out, I don't always bother making it pretty. I'm well aware of the risks in client-side validation, but indeed, as I see in my job often enough (I'm a security consultant), it's a valid remark that not everyone has taken to heart quite yet so thanks for the comment :)
- tomsmeding 6y agoAh yes, preventing uglier server-side errors is indeed a very valid reason. :)