![]() |
Update a Select with onchange of other Select - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Update a Select with onchange of other Select (/showthread.php?tid=13358) |
Update a Select with onchange of other Select - El Forum - 11-19-2008 [eluser]Nuno Simões[/eluser] I there, I'm a newbie on CI and I'm having a problem: On my view page nammed init.php, I have two select boxes on a form and I want to update one select (modelo) with data from database after change selection on other select (fabricante). Does anyone tell me the better way to do this? Thanks a lot! There's the Code: Code: <form name="detailsearch" action="#" method="get"> Update a Select with onchange of other Select - El Forum - 11-20-2008 [eluser]abmcr[/eluser] i think do you nedd use an ajax wrapper..... after select in the first select box, you call the ajax function for populate the second select Update a Select with onchange of other Select - El Forum - 11-20-2008 [eluser]Nuno Simões[/eluser] Thanks for the answer abmcr. I've already worked with the SACK, but I don't know how to integrate this with CodeIgniter. I'm searching right now for a good tutorial 'bout jQuery and CodeIgniter, one that explains the things, not the ones that teaches you to do a thing and nothing more. If you know some, report it to me, OK? Thanks a lot Update a Select with onchange of other Select - El Forum - 11-20-2008 [eluser]abmcr[/eluser] The php code in a view Code: $js = 'onChange="get_dati_gerachia()"'; Code: function get_dati_gerachia(){ Code: function the_url_of_your_ajax_controller(){ Update a Select with onchange of other Select - El Forum - 11-20-2008 [eluser]Nuno Simões[/eluser] Thanks, I had some problems getting the selected value, but is solved now. I have another question, what do I need to load to make the next piece of code to work: Code: $.ajax({ Update a Select with onchange of other Select - El Forum - 11-20-2008 [eluser]abmcr[/eluser] Oooops...... i forget! In this sample i have used jquery librarie.... only the core download at www.jquery.com Ciao! Update a Select with onchange of other Select - El Forum - 11-20-2008 [eluser]Nuno Simões[/eluser] It worked! ![]() If you come to Portugal, just let me know and I pay you a beer! ![]() |