Dependent drop down not displaying anything - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18) +--- Thread: Dependent drop down not displaying anything (/showthread.php?tid=61945) |
Dependent drop down not displaying anything - karmad - 06-02-2015 I have this simple dropdown menu in my codeigniter form. When clicking dzongkhag(district) it should display the list of geogs(towns), but, instead it do not do so. Only the list of geog(town) is populated from the database table. The drop down menu that I have is not the best one but that is what I could come up with after trying (for many weeks) many times unsuccessfully. I will be grateful if someone could help me out/solve/advice on this. Here are the snippets view.php Code: <label >Dzongkhag: </label> Code: $(document).ready(function(){ Code: public function select_auth_geog(){ Code: public function select_auth_geog($user_dzongkhag){ RE: Dependent drop down not displaying anything - AidanW - 10-19-2015 Hey karmad Be good if you could post up the whole function in the model. Also are there any errors coming back on the request or is it empty? You can check using developer tools on your browser eg Chrome via the network tab. RE: Dependent drop down not displaying anything - Wouter60 - 10-21-2015 Instead of PHP Code: data:"user_dzongkhag="+user_dzongkhag, PHP Code: data: { "user_dzongkhag" : user_dzongkhag }, You can also save yourself a lot of time and effort if you put the district names in an array (in your controller). You can pass this array to your view to build the list of districts. And you can pass it to your model to determine which cities belong to the selected district. |