CodeIgniter Forums
dropdown 1 selection populates dropdown 2? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: dropdown 1 selection populates dropdown 2? (/thread-49717.html)



dropdown 1 selection populates dropdown 2? - El Forum - 02-29-2012

[eluser]w1n78[/eluser]
i have 2 drop down menus. the first drop down is a list of districts. the second are schools. if a district is selected, i'd like the schools that belong to that district populate the 2nd drop down. here's how my db looks like

district table
district_id
district_name


school table
school_id
school_name
district_id

so the relationship is district.district_id = school.district_id. before MVC i used jquery and passed the IDs through the querystring and used $(.get). i know how to set up the models but how do i get the controller to work? i'd like this to be in one form on one page.


dropdown 1 selection populates dropdown 2? - El Forum - 02-29-2012

[eluser]xeroblast[/eluser]
use AJAX on this one if you dont want a page refresh. or could just use simple php.