I need some help in ajax when onchange
event fire in dropdown I want the value in controller but I did not get it.
Here is my view 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>
Below is my AJAX code:
function calculate(id)
{
var id=id;
$.ajax({
type:'POST',
url:'welcome/user_manager',
data:{'id':id},
success:function(data){}
});
}
This is my CONTROLLER:
public function user_manager() {
$id=$this->input->post('id',true);
}