Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have question and 2 answer for this question below that, try to improve these

ID: 3873993 • Letter: I

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 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.

Explanation / Answer

Before asking how to do data validation we should know first that why do we need to do data validation . Data validation is needed in that cases where we have to store some data in our database and we all know that database has a structure and a specific type of data can be entered in each field . So valid data must be entered in the database for this purpose we need to do data validation.

In order to have data validated we should prefer server side validation over client side as your first answer suggested that the client side validation can be circumvented by some smart user, and this will result in allowing the user to post some invalid data to the server and this way invalid data gets entered in the database . In order to protect this server side validation is must , Server side validation protects the database from loosing its integrity and protect the server from any invalid data. As your second answer suggests that in addition to server side validation ( must have ) client side validation can be provided for the user to interactively know that he/she is entering the wrong data and this interactivity can be further enhanced by the use of javascript.

PLEASE RATE !! and Upvote