jimfog Posted May 22, 2013 Share Posted May 22, 2013 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 More sharing options...
Ingolme Posted May 22, 2013 Share Posted May 22, 2013 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 More sharing options...
jimfog Posted May 22, 2013 Author Share Posted May 22, 2013 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 More sharing options...
thescientist Posted May 22, 2013 Share Posted May 22, 2013 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 More sharing options...
jimfog Posted May 22, 2013 Author Share Posted May 22, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now