Welcome Guest, Not a member yet? Register   Sign In
Triple Drop Down
#3

Both your AJAX methods load the same view that was initially loaded for displaying the page:
PHP Code:
$this->load->view('cascadeDrop',$data); 
That's not the way to add or manipulate content on a page without a complete page refresh.
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. 
This will return only the html code for one of the dependent dropdowns.
Reply


Messages In This Thread
Triple Drop Down - by goutambose - 08-07-2016, 10:48 PM
RE: Triple Drop Down - by PaulD - 08-08-2016, 09:02 AM
RE: Triple Drop Down - by Wouter60 - 08-08-2016, 10:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB