DEV Community

Discussion on: Input Validation: Client-side or Server-side?

Collapse
 
rajmichaels profile image
rajmichaels • Edited

IMO, we should have the validation on both.

Server Side Validations: Whether you are having validations in client or not. You must have all the validations in server. Since the server only has high responsible for storing the valid data and to protect malicious data sent from the user. So you must have all the field validations in server.

Client Side Validations: This is for users usability experience. Through client validations you can avoid unnecessary network calls by which user can instantly aware of the possible field values and correct it. So, client side Validations are “a nice to have” to improve the user experience.