
January 29th, 2010, 12:50 AM
|
 |
Code Monkey V. 0.9
|
|
Join Date: Mar 2005
Location: A Land Down Under
|
|
|
It depends on when you want to perform the check. Basically, there's two ways to do it:
1. Check on form submission.
This is the easy one. Whenthe form is submitted, check in the database to make sure that the requested username doesn't already exist, and if it does show an error the same way that you would with the rest of your form validation.
2. Check when entered.
To do this, you can use an AJAX query to get a response from the server and display this to the user when they are still on the page. It still needs to do the same thing of checking in the database to see if the username has been used before, but may help with the overhead of submitting the full form each time.
|