Update a Select with onchange of other Select |
[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">
[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
[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
[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(){
[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({
[eluser]abmcr[/eluser]
Oooops...... i forget! In this sample i have used jquery librarie.... only the core download at www.jquery.com Ciao!
[eluser]Nuno Simões[/eluser]
It worked! Thanks a lot. If you come to Portugal, just let me know and I pay you a beer! |
Welcome Guest, Not a member yet? Register Sign In |