Why validate forms on the client side if they need server-side (ajax) validation to prevent hacking?
Is there a benefit to having both client-side and server-side (ajax) form validations?
Both methods achieve the same goal, but ajax takes 300ms while client-side validation is instant. Is it worth duplicating the validation process for this small time delay? :P
Using only server-side validation can remove unnecessary JavaScript from the client side, leading to faster loading times. Do you see any benefits in having both types of validation?
If opting for client-side validation, is there a way to ensure that validation is not duplicated on the server side? For example, only proceeding with the action/request if the client-side validation passes?
Here's my reasoning:
Server + Client-side validation: fewer requests -> more code (duplicated) -> more complications -> better UX Server-side validation only (ajax): more requests -> less code -> fewer complications -> potentially similar UX
Apologies for my mix of languages here asd :D