Help with Ajax Autocomplete - 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: Help with Ajax Autocomplete (/showthread.php?tid=5778) |
Help with Ajax Autocomplete - El Forum - 02-03-2008 [eluser]josebalius[/eluser] Hey guys, I am fairly new to this library and I was wondering if I could get some assistance on my problem. Here is the controller: Code: class Home extends Controller { And here is are two parts of the view (a lot of html that I don't wanna post) Code: ALL HTML CODE here Problem is that when I try it, it doesn't show anything at all, now if I change /home/get_list to "get_list" by itself (invalid URL) then it does work but with a 404 Error of course, so I was wondering why when I provide the correct url it doesn't show anything? Im I showing my HTML results incorrectly? Thanks Jose Help with Ajax Autocomplete - El Forum - 02-03-2008 [eluser]Pascal Kriete[/eluser] Code: $this->load->view('viewname'); Help with Ajax Autocomplete - El Forum - 02-03-2008 [eluser]josebalius[/eluser] Sorry I forgot to post another part of the controller: Code: function index() { Help with Ajax Autocomplete - El Forum - 02-03-2008 [eluser]Pascal Kriete[/eluser] Ah, it seems I missread your first post, as well. Try loading the url helper and doing: Code: site_url("home/get_list"); Help with Ajax Autocomplete - El Forum - 02-03-2008 [eluser]josebalius[/eluser] Thank you so much! that seemed to work perfectly! Help with Ajax Autocomplete - El Forum - 02-03-2008 [eluser]josebalius[/eluser] I was wondering if anyone could tell me, how i can get the input to use in my function? For example I have function get_list(), I tried function get_list($input) but and error came up. nvm, for other learning users: use $_POST['fieldname']; Help with Ajax Autocomplete - El Forum - 02-04-2008 [eluser]josebalius[/eluser] Sorry for the third post in a row (is it allowed?) But now I am using the: Code: $this->ajax->remote_function('elementforresult', array('url' => '/checkuser/'); On a button however I don't understand how I would be able to set a parameter? For example if I have a form with a field that I want to be send when a user clicks on a special ajax button, how can I make that remote_function grab the value by its ID or something? I just don't know how to call it with the PHP options. Help with Ajax Autocomplete - El Forum - 02-04-2008 [eluser]Pascal Kriete[/eluser] I have no clue how to do it with that library, but if it helps, this is how you would do it with regular js using prototype: In the html head tag: Code: function init() { Help with Ajax Autocomplete - El Forum - 02-04-2008 [eluser]josebalius[/eluser] Okay I was able to play around with the ajax code and I have gotten this so far: Code: new Ajax.Updater('box', '/view_newsletters/preview',{ This is inside a form, which has the "htmlcontent" field. This was done by using the following php code: Code: $this->ajax->remote_function( However my $_POST are coming out blank, no vars what so ever (I am doing a var_dump) Can anyone help? Help with Ajax Autocomplete - El Forum - 02-04-2008 [eluser]Greg Aker[/eluser] If you haven't seen it, check out Derek Allard's video tutorial at: http://video.derekallard.com/ -greg |