ajax autocomplete |
[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.
[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...
[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.
[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
[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')); |
Welcome Guest, Not a member yet? Register Sign In |