Skip to content

Instantly share code, notes, and snippets.

@donaldallen
Created February 20, 2013 19:33
Show Gist options
  • Save donaldallen/4998571 to your computer and use it in GitHub Desktop.
Save donaldallen/4998571 to your computer and use it in GitHub Desktop.
// View
$('select#sales_rep').change(function(e) {
$.ajax({
type:'POST',
url:'/ajax/getSalesIds',
dataType:'json',
data:{ id:$(this).val(), token:csrf },
success: function(data) { console.log(data); },
error: function(XMLHttpRequest, textStatus, errorThrown) { console.log(errorThrown); }
});
});
// Controller
public function getSalesIds()
{
header('Content-Type: application/json');
echo $this->ion_auth->user($this->input->post('id'))->row()->sales_id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment