![]() |
ajax autocomplete - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: ajax autocomplete (/showthread.php?tid=29389) |
ajax autocomplete - El Forum - 04-08-2010 [eluser]outtolunch[/eluser] Hello evyerone, Anyone tried implementing this-> http://codeigniter.com/wiki/Ajax_Autocomplete/ I can't get this thing to work. Could anyone give me a hand? Regards. ajax autocomplete - El Forum - 04-08-2010 [eluser]n0xie[/eluser] Could you show us some code? What did you try? What works? What doesn't work? Sorry my crystal ball is broken today... ajax autocomplete - El Forum - 04-08-2010 [eluser]outtolunch[/eluser] I loaded up the Javascript files into my view called header.php: Code: [removed][removed] My autocomplete.js file looks like that: Code: function lookup(inputString) { Controller: Code: function autocomplete() Model: Code: function get_autocomplete($input){ HTML Code: <form id="search" name="search" action="" method="post"> So yeah, I managed to make it work, but when you type in anything it returns all the results, which i'm not happy about. ajax autocomplete - El Forum - 04-08-2010 [eluser]InsiteFX[/eluser] @n0xie, Quote:Could you show us some code? What did you try? What works? What doesn’t work? Sorry my crystal ball is broken today… Gee I always thought that you could see the FUTURE LOL. InsiteFX ajax autocomplete - El Forum - 04-12-2010 [eluser]Victor Michnowicz[/eluser] I think the problem is that in your JS you are naming your POST variable "queryString" and in your PHP it is "name." Try changing this: $query= $this->Data->get_autocomplete($this->input->post('name')); to this: $query= $this->Data->get_autocomplete($this->input->post('queryString')); |