It can be very useful for the user to get real-time feedback regarding validation errors as they type in your web form. If you are performing client-side validation with JavaScript as well as server-side validation, this can be achieved easily as you do not need to send a request to the server every time the user types in an input—you can do it all within the client. Once again, it is very important that the same data undergoes additional validation on the server side. The server-side validation can then be fed back to the web form after the user has submitted the form.
This recipe will adapt the client-side validation that has been created as part of the last five recipes. Ensure that you have completed these recipes beforehand.