Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: 'yourusernamecheckpage.php',
- type:'post',
- data:{'username':$('#yourusername').val()},
- beforeSend:function(){
- //do a loading msg..like checking..
- },
- success:function(msg){
- if(msg == 'ok'){
- //username available
- }else{
- //username not available
- }
- },error:function(msg){
- alert(msg);
- }
- });
- //yourusernamecheckpage.php
- //you can get the username as $_POST['username']:
- //do your validation and
- echo 'ok';exit;
- //if available
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement