Triple Drop Down |
I have 3 database.
I use this code,when i click category sub category drop down not populated.here is my code. I want help category : cat_id,category Sub-category: sub_id,sub_name,cat_id company:id,cat_id,sub_id, cname, cadd, cweb model file :Cities_countries_model Code: <?php controllers:countries Code: <?php views:cascadeDrop Code: <html xmlns="http://www.w3.org/1999/xhtml">
First, try echoing (with print_r) the array you are expecting on the page somewhere so you can see if it is actually populated or not. At least then you will be able to tell if the problem is in your js or your html or your php or your sql.
Just do this at the top of your view (after your body tag of course) PHP Code: <p><?php echo print_r('my_array');</p> May I say, with the greatest possible respect, your HTML is horrible :-) Code: <td><div align="center">:</div></td> Try some css on the table data.
Both your AJAX methods load the same view that was initially loaded for displaying the page:
PHP Code: $this->load->view('cascadeDrop',$data); The AJAX method must echo the new output you need. In your case, just the (html) contents of a dropdown for selecting a state or city. Try to build this html inside the controller first. If needed, you can put it in a view, and load it like this: PHP Code: echo $this->load->view('dropdown_cities',$data,TRUE); //the 3rd parameter (TRUE) will return the output as a string. |
Welcome Guest, Not a member yet? Register Sign In |