Question: I have question and 2 answer for this question below that, try to improve these two answer and Feel free to agree or disagree with
I have question and 2 answer for this question below that, try to improve these two answer and Feel free to agree or disagree with it (in 2 or 3 short paragaraph) and for each answer write seprated IMPROVMENT (NOT TOGHETHER) Be detailed in your postings. Please ensure that your postings are civil and constructive.
Question:
Do you prefer to do data validation using HTML5 or do it on the server side? Discuss.
Answer 1:
Server side validation must always be done regardless of whether there is client side validation. It is very easy for client side validation to be circumvented and it cannot be relied upon to protect data integrity. Client side validation using HTML 5 is nice as it can provide feedback to the user before the data is posted to the server. This can be further enhanced by using JavaScript for more complicated validation rules. I see client side validation as simply a way to improve the user experience.
Answer 2:
Data validation in my opinion should be done on both the client and server side. Client side validation can be done in HTML5 but it can also be done via JavaScript. The server should always perform data validation because you never want the server to choke due to a bad request, you want to respond in a friendly manner not with a 500 error. Also, a server does not have to be accessed by a browser client. You can run headless clients or web services as well. So in the case of the browser not being in the picture the data validation on the server becomes even more important. The client should also validate as much as possible. If the client can prevent bad data from going to the server it helps prevent issues. It also prevents unnecessary server calls by not allowing data to be sent until it is in a valid form.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
