For instance (THIS IS NOT TESTED) you could have this:
Code:
<input type="text" id="username"><br>
<span id="returnMessage"></span>
Then at the botton of the page or in an external file have
Code:
$('#username')..keyup(function(event){
var username = $('#username').val();
$.post("check.php", { username: username" },
function(data){
$('#returnMessage').html(data);
});
});
Then on check.php this will be my example.
PHP Code:
// NO SECURITY ON THIS CBS
if ($_POST['username'] == 'Jack'){
echo 'This username is taken';
}else{
echo 'This username is free';
}
?>