After each character you type, AJAX checks to see if the username is long enough, has invalid characters, and checks the database to see if it is already taken - All without refreshing the page.
Try it out! Type in a new username and click Add to Database!
Then, try to type that same username in and see the message you get.
Or, try it with the following names:
- Brian
- Angel
- Hannah
- Butler
- name123
- brian@bcbutler.com