Twitter-like Registration with DX Auth - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Twitter-like Registration with DX Auth (/showthread.php?tid=20954) |
Twitter-like Registration with DX Auth - El Forum - 07-26-2009 [eluser]K.Brown[/eluser] I'm using DX Auth, and I'd like to to behave like twitter's registration--in the sense that it will check the database via ajax to make sure the username/email doesn't conflict... Has anybody done this? If I have to pick a js library, I'd use jQuery! Twitter-like Registration with DX Auth - El Forum - 07-27-2009 [eluser]xzela[/eluser] Actually, I've done something very similar to what you've described. I didn't use the Auth library you supplied but my method should work nearly the same way. I created a Callback using the form validation library. however, i didn't call it via a typical post request. I called it with a jQuery ajax.post request. If the call back found a match for that username, it would respond with a message. See jQuery post documentation here: http://docs.jquery.com/Post Registration controller: Code: $this->load->library('form_validation'); callback function Code: function CB_testUserName($str) { registration model Code: function testUsername($name) { that should do it. Twitter-like Registration with DX Auth - El Forum - 07-27-2009 [eluser]K.Brown[/eluser] Alright. Here's where I’m at: I have the validation working! All I need to do is get it jquery-ed up! Twitter-like Registration with DX Auth - El Forum - 08-10-2009 [eluser]juliano.ma[/eluser] Hello, I am trying to implement this validation in real time on my form, but I must be missing something. I have installed the JSON. You could post an full example in the controller and view, please? Code: <?php Where i use this below, in controller or view?: Code: $json = array(); Look my view: Code: <?=$this->validation->error_string; ?> Twitter-like Registration with DX Auth - El Forum - 08-10-2009 [eluser]jcavard[/eluser] DX Auth already has a built-in function to check username availability. Code: $result = $this->dx_auth->is_username_available($username); // bool Twitter-like Registration with DX Auth - El Forum - 08-12-2009 [eluser]juliano.ma[/eluser] Thanks for the response jcavard, but I would do it in real time, using the onKeyUp javascript event with jquery. Someone have some example? Twitter-like Registration with DX Auth - El Forum - 08-12-2009 [eluser]jcavard[/eluser] I guess you just bind a ajax call to onKeyUp of the username textbox, then you can a script that execute the is_username_available(). |