1

Possible Duplicate:
Why is client-side validation not enough ?

you have to validate data before store it.

validate in client side or server side or both?

what's your consideration?

Community
  • 1
  • 1
lovespring
  • 19,051
  • 42
  • 103
  • 153
  • 2
    possible duplicate of [Why is client-side validation not enough ?](http://stackoverflow.com/questions/3483514/why-client-side-validation-is-not-enough) – Pekka Dec 30 '10 at 12:26
  • Given the referenced question, this question is becomes basically, `why not just server-side validation?` – Bert F Dec 30 '10 at 12:39

1 Answers1

5

My consideration: both.

  1. client-side - more user-friendly (e.g can respond right after leaving the field, no full-page reload, quicker response since no roundtrip network request, etc)

  2. server-side - because you shouldn't trust the client

The drawback is of course maintaining the rules in both places, especially if they are in different languages/frameworks.

Community
  • 1
  • 1
Bert F
  • 85,407
  • 12
  • 106
  • 123