Onchnage event fire and get id in controller using ajax |
Hello guyz i need help in ajax when onchange event fire in dropdown i want the value in controller but i did not get it
Here is mu code: VIEW: <select name="user_role" id="user_role" onchange="calculate(this)"> <option>--Select User--</option> <?php foreach ($roll_get as $roll) { ?> <option value="<?php echo $roll->user_id; ?>" id="<?php echo $roll->user_id; ?>"><?php echo $roll->full_name; ?></option> <?php } ?> </select><br> AJAX: function calculate(id) { var id=id; $.ajax({ type:'POST', url:'welcome/user_manager', data:{'id':id}, success:function(data){ } }); } CONTROLLER: public function user_manager() { $id=$this->input->post('id',true); } |
Messages In This Thread |
Onchnage event fire and get id in controller using ajax - by jaydevvara - 07-17-2018, 05:43 AM
RE: Onchnage event fire and get id in controller using ajax - by php_rocs - 07-17-2018, 08:27 AM
RE: Onchnage event fire and get id in controller using ajax - by jaydevvara - 07-17-2018, 09:18 PM
RE: Onchnage event fire and get id in controller using ajax - by Pertti - 07-17-2018, 11:31 PM
RE: Onchnage event fire and get id in controller using ajax - by jaydevvara - 07-18-2018, 04:58 AM
RE: Onchnage event fire and get id in controller using ajax - by jaydevvara - 07-18-2018, 04:59 AM
RE: Onchnage event fire and get id in controller using ajax - by InsiteFX - 07-18-2018, 03:48 AM
RE: Onchnage event fire and get id in controller using ajax - by jaydevvara - 07-18-2018, 04:58 AM
|