Welcome Guest, Not a member yet? Register   Sign In
how to use Ajax with CodeIgniter in a combo box
#3

[eluser]Berserk[/eluser]
your controller :
Code:
function get_cities(){
$cities = $model->get_cities();
echo json_encode(array('status'=>'1','cities'=>$cities));
}
your js (jQuery) function:
Code:
function get_cities(){
$.post(your_controller_url,{postdata:postdata},function(data){
   if(data.status==1){
     // print your view here
   }
},'json');
};


Messages In This Thread
how to use Ajax with CodeIgniter in a combo box - by El Forum - 11-04-2009, 11:24 AM
how to use Ajax with CodeIgniter in a combo box - by El Forum - 11-04-2009, 03:58 PM
how to use Ajax with CodeIgniter in a combo box - by El Forum - 11-04-2009, 09:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB