Ajax and CI : I am lost |
[eluser]TDSPower[/eluser]
Hello, I am working on my CI project. I meet an error with the Autocompletion with the CI Ajax Library. I create a controller which will show the form : Code: class Accueil extends All_accueil { Here is the view (form), the input type text categorie is normally autocompleted (with the LI created with auto())... Code: <form action="test.hpp" name="a"> Nothing appears when i write some text on the input text... When I look on firebug : Quote:Erreur : $(element) has no properties Don't understand where is the problem with such an implicit error ! Thanks a lot, François
[eluser]sandwormusmc[/eluser]
I'm not too familiar with the prototype framework, but it looks like it's having trouble selecting the id of the element on line 987 of the prototype.js code. Can you post that snippet of code also? In MooTools, which I've been (successfully, so far) using with CI, I can call /controller/functionName through an AJAX call and specify the updated id within the ajax object as such: Code: --removed-- Is it a similar setup with Prototype?
[eluser]TDSPower[/eluser]
Thanks for these very fast answers... I don't think the problem is in the prototype javascript ! It is a JS Framework reference as you know. I post some line where the error is indicated : Quote: hide: function(element) {
[eluser]sandwormusmc[/eluser]
Try using this in your view instead of what you have: Code: echo $this->ajax->auto_complete_field('changeMe*',array('url'=>'/accueil/auto','update'=>'categorie')); The 'update' parameter should specify which DOM ID the JavaScript will change when it runs ... *<change this to the DOM ID of your form>
[eluser]Pascal Kriete[/eluser]
Could you post the code that gets generated here: Code: echo $this->ajax->auto_complete_field('categorie',array('url' => '/accueil/auto'));
[eluser]TDSPower[/eluser]
I am so a dumb... I do not deserve your precious help... I put scriptaculous before prototype... And we have to put : For others noobs, I put the final code : Code: <? Sorry again
[eluser]Nick Husher[/eluser]
Just so you know, the ExpressionEngine Forum is wreaking havoc on your examples. It'll hack out anything that even starts to resemble a cross-site scripting attack.
[eluser]porky_voice[/eluser]
Greetings! Having a hard time on using ajax: $this->ajax->auto_complete_field('username', array('url' => 'controller/ajax_search', 'update' => 'div id')); instead of displaying the list or username, it display the whole webpage like (controller/index). i wonder why.. i'm newbie BTW. Thanks for sharing your small time. |
Welcome Guest, Not a member yet? Register Sign In |