Live Username Availability Checking using Ajax and jQuery. Demo Available

Simple script to check username availability using jQuery and Ajax. Try out demo and use it. I used gif loader and jquery fade in effects to make it fit. You can find many script like this but i want to keep my valuable users here to share their development needs.
Table Structure
CREATE TABLE IF NOT EXISTS `username_availablity` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(60) NOT NULL, PRIMARY KEY (`id`) )
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | if($_REQUEST) { $username = $_REQUEST['username']; $query = "select * from username_availablity where username = '".strtolower($username)."'"; $results = mysql_query( $query) or die('ok'); if(mysql_num_rows(@$results) > 0) // not available { echo '<div id="Error">Already Taken</div>'; } else { echo '<div id="Success">Available</div>'; } } |
jQuery Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | $(document).ready(function() { $('#Loading').hide(); }); function check_username(){ var username = $("#username").val(); if(username.length > 2){ $('#Loading').show(); $.post("check_username_availablity.php", { username: $('#username').val(), }, function(response){ $('#Info').fadeOut(); $('#Loading').hide(); setTimeout("finishAjax('Info', '"+escape(response)+"')", 450); }); return false; } } function finishAjax(id, response){ $('#'+id).html(unescape(response)); $('#'+id).fadeIn(1000); } |
HTML
1 2 3 4 5 6 | <div> <label>User Name</label> <input id="username" name="username" type="text" value="" onblur="return check_username();" /> <div id="Info"></div> <span id="Loading"><img src="loader.gif" alt="" /></span> </div> |
Who I Am

Zeeshan Rasool
Software Engineer - PHP
Lahore - Pakistan
zeeshan(@)99points.info
Skype: zeeshan-rasool
gTalk: zishan.rasool85
Categories
- AJAX (37)
- Codeigniter (16)
- CSS (16)
- Facebook (11)
- Joomla (1)
- JQuery (53)
- Miscellaneous (4)
- Mootools (1)
- MySQL (6)
- PHP (60)
- SEO (2)
- Technology (6)
- Tutorials (15)
- Twitter (2)
- Web Design (23)
- Web Development (57)
- WordPress (2)
Tags
99points
adobe
AJAX
ajax pagination
ajax rating
ajax tutorial
ajax voting system
captcha
Codeigniter
codeigniter 2.0
codeigniter recaptcha
CSS
css tutorials
dreamweaver cs5
Facebook
facebox
farmville
ffmpeg
flv
google api
hacking
Joomla
JQuery
JQuery Gallery
JQuery menus
Jquery tutorial
mafia war
Mootools
MySQL
pagination
Payment
PHP
php curl
recaptcha
RSS Feed
SEO
simplepie
socail networking
ssl
Tutorials
Twitter
wall script
Web
XSS
youtube
Comments
- ZeeShaN on Facebook Wall Script Clone with JQuery and PHP: Personal Project BETA Version 2.0
- 20 + Fresh jQuery Image Gallery/Slider Plugins and Tutorials Worth a Look | free on JQuery Based Flipped Image Gallery with Bounce Effects
- 20 + Fresh jQuery Image Gallery/Slider Plugins and Tutorials Worth a Look | free on Fresh JQuery Image Gallery with Captions and Auto Play/Pause Rotation
- 25 Cool and Helpful jQuery Plugins/Tutorials For Your Next Project | free on jQuery Tutorial: Create jQuery and CSS based Awesome navigation.
- 25 Cool and Helpful jQuery Plugins/Tutorials For Your Next Project | free on Ajax Tutorial: How to Create Ajax Search Using PHP jQuery and MYSQL
ZeeShaN






welcome Debasish
thank you vary much Zeeshan….i really appreciate this site.it has helped me a lot.keep it up.GOD bless you..
[...] 10) Live Availability Checking with Ajax and jQuery [...]
[...] Demo Download [...]
[...] 10) Live Availability Checking with Ajax and jQuery [...]
[...] 10) Live Availability Checking with Ajax and jQuery [...]
IE fix
username: $(‘#username’).val(),
after .val() remove comma (,)
thanks
this script not working IE6
Your example here has been a great help! Thanks so much for posting – perhaps I can add you and outsource some work to you?
Do you work freelance?
Regards,
Marc.
[...] Live Username Availability Checking using Ajax and jQuery. Demo Available [...]