what I am trying to ask is , I am using Angular in client side and laravel Api in server side. so my question is, Is it better approach to put data validations on both side.
Asked
Active
Viewed 45 times
0
-
2Yes - I always do both (when I do it at all). Server-side is 100% the most important though. – Reinstate Monica Cellio Nov 21 '16 at 11:44
-
1yes it's always better approach to put validation both side. So that not even a single % chance will be there for errors – Alive to die - Anant Nov 21 '16 at 11:44
-
2Possible duplicate of [JavaScript: client-side vs. server-side validation](http://stackoverflow.com/questions/162159/javascript-client-side-vs-server-side-validation) – Iulia Mihet Nov 21 '16 at 11:45
-
to put it simple: *server*-side validation is neccessary, *client*-side validation is user-convenience. – Franz Gleichmann Nov 21 '16 at 11:48
2 Answers
2
Yes. You should use both.
Client side - most validations are for the user inputs (e.g. invalid characters, regular expressions, etc.)
Server side - most validations are related to business logic (e.g. user authority, use privileges, etc.)

Carlo S
- 63
- 8
0
Server-side validation is enough to have a successful and secure form validation. For better user experience, however, you might consider using client-side validation.

Massi Issar
- 403
- 5
- 23