« Back to jQuery Live Ajax Check Availability article
This jQuery plugin automatically checks for username availability as long as the minimum criteria are met - minimum length of 3 letters and maximum length of 20 characters. It will NOT send (waste!) a server request unless the username validates first.
The plugin also includes a username validation function which uses a regular expression. The input must have a minimum length of 3 and a maximum length of 20 and it can contain letters only. Of course, you can edit this based on your requirements as long as the function returns a boolean value.
Also note that your ajaxSource page should also perform server side validation. Once validated server side then you can perform the lookup against your database and write (i.e. PHP echo or ASP Response.Write) the response to be displayed in the id defined in the plugin as the 'target'.