Possible Duplicate:
Why is client-side validation not enough ?
you have to validate data before store it.
validate in c开发者_运维百科lient side or server side or both?
what's your consideration?
My consideration: both.
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)
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.
精彩评论