Summary
While we don’t claim to have built the perfect validation technique, we provided a working proof of concept; a working application that takes care of user input and ensures its validity.
You cannot do that only with JavaScript nor would you want to wait for the field to be validated only on form submit.
The reason we used AJAX for pseudo client-side validation instead of simple JavaScript validation is that in many scenarios form fields need to be checked against a database (like the username field in this case). Also, in most cases it’s more professional to have all the business logic (including the validation) stored in a central place on the server.
AJAX can be so handy, don’t you think?