Monday 22 August 2016

codeigniter ajax username/email availability check using JQuery

Here is the simple script to check live username or email availability using jQuery’s Ajax method in codeigniter. you can also apply this logic/method to any other filed check.
Controller : application/controller/User.php
we are using in build codeigniter form validation library’s is_unique() function to check email/username availability so i am not created any modals here, in the blow controller you can find both server side and client side email/username validations. and one more thing i have used ci’s output class to echo output to ajax response, with and by using output class we can avoid 500 internal errors with compression enabled mode in codeigniter.
View : application/views/user.php
In the view we have created a form included jQuery library and our custom jQuery to send request to server and to handle the response.We are sending Ajax request only if the given input is valid email address.
That’s it.

No comments:

Post a Comment

Installation of Drop Box API on Codigniter

As with the YouTube API the first step in getting this sucker setup is getting a developer key by visiting  https://www.dropbox.com/develop...