We make an Ajax call to our processing page – where it does the validation in our PHP code previously.When in comes to validating forms, there are basically two techniques you can use: 1) Server-side validation and 2) Client-side validation.Server-side validation is when form data is submitted, server analyzes then returns the user back to the form when items are invalid.Note that in our case – I’m simply checking if first name and email is empty.Of course in the real world, you will have to check for valid email and such.In any web application user data must be translated from HTML form data to native types and database types, and back again. The "right way" to handle custom types is to extend Django's widgets, form fields and model fields.However, understanding exactly how these types perform each step of the conversion can be confusing.This is the generic term I use to describe the most appropriate Python data type for a particular field's data.It might be a builtin type or it could be an instance of a class someone created. But even in this "simple" case it's important to remember that the string is not necessarily exactly what will be sent to the browser or the database.Of course, if there’s no errors – the form does a hard .submit() – to the same processing page and handled accordingly.Of course, we have add our styling so our field will look like our screenshots above. Again, the styles are real basic and you probably want to do better in your own forms. We’ve combined best of both worlds: server side and client side validation in one solution (thanks to Ajax). If a field validation rule has to change – we only need to change it in one place: the server code.