Codeigniter Tutorial: How To check Username/Email availablity using jQuery in Codeigniter?

Author: Zeeshan Rasool  |  Last updated on Codeigniter, Web Development

This post is for CI lover who wants to learn Codeigniter. This script will show you how can we check live availability of username or email using Ajax in Codeigniter. Using this tutorial you can also understand how can we send a jQuery Ajax request to server living in CI.

In your view where you have created form include jQuery library and put the below code there.
In header section:

In body section in your form:

In Your controller add this function:

Suppose you have a model called my_model.php and a table tbl_members or what ever you named. This table should have a field named “email” of type varchar [200].
Add this function:

That’s it, this function will return a message against email field that whether it is available or not. This is not for only email, you can use it to check any field. Also this is client side check so you also need to use this model function in server side so that email can also be verified when form has been submitted with disabling javascript .

Recommended WordPress Themes Store

If you enjoyed this post, please consider leaving a comment below or subscribing to the RSS feed to have future articles delivered to your feed reader. You can also follow us on Facebook or Twitter @99Points

This awesome post has been created by 99Points editor's team. You can follow our updates on Twitter and facebook, OR drop an email at

Email Subscriber!

Be the first to know about new updates



Popular post