AJAX check user name script - 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: AJAX check user name script (/showthread.php?tid=36442) |
AJAX check user name script - El Forum - 12-01-2010 [eluser]mabright[/eluser] Hello All, I am implementing a AJAX based check username script(papermashup.c o m/demos/check-username/) and I cannot get it to function properly. Below is my code. When I keyup on my user name field, nothing happens. I put my AJAX code in a function inside an AJAX controller. Am I using the AJAX call correctly with the controller? AJAX COntroller Code: <?php JavaScript Code: [removed][removed] User Sign Up View Code: <li> AJAX check user name script - El Forum - 12-01-2010 [eluser]nuwanda[/eluser] One thing. Your ajax data option should be like this: Code: data: ({name: value}) AJAX check user name script - El Forum - 12-01-2010 [eluser]cideveloper[/eluser] first thing you need to do is get firebug for firefox. This will allow you to test if your js is working properly. Use the console tab - All to see if the javascript is sending the ajax call if username.length >= 6. Also what do you mean nothing happens? For me, the border color change does work but I am always getting a null response form your url. Nothing is being echoed. Simply returning $result will not echo anything from the controller. I would make the following changes to your controller. AJAX Controller Code: public function checkhandle() AJAX check user name script - El Forum - 12-01-2010 [eluser]mabright[/eluser] It was my controller. Thanks for the input. |