Jump to content

server-side validation


jimfog

Recommended Posts

I know how to perform server validation but just recently a question popped in my mind(triggered by client-side validation ). Is the reason we perform server-side validationonly for the case where js is disabled or it can be useful also when js is enabled(acting as a double check).

Link to comment
Share on other sites

You can never tell, from the server side, if Javascript was enabled, so server-side validation must always be performed. Javascript validation is just for the user's convenience. People can also find ways to get around Javascript validation if they want to.

Link to comment
Share on other sites

Ok, as you say we always do server-side validation.Suppose server validation finds error indeed in the user submitted data----how these errors going to be communicated back to the user(client mashine), with AJAX...?I am talking about the case where js is enabled of course.

Link to comment
Share on other sites

that is up for you application to handle. the response you generate from an AJAX request on the server side, should be meaningful enough for the Javascript to know what to do with it. If you are writing both, then it is entirely up to you how the two shall come to a mutual understanding.

Link to comment
Share on other sites

that is up for you application to handle. the response you generate from an AJAX request on the server side, should be meaningful enough for the Javascript to know what to do with it. If you are writing both, then it is entirely up to you how the two shall come to a mutual understanding.
I still have to learn some things about frontend development...
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...