Get user ID from dropdown and show content related

Get user ID from dropdown and show content related

The admin has a drop down of all the current users in the system.

On a particular page it loads content related to that user when they are logged and it’s based off their user ID.

What I’m trying to do is when the admin clicks another users in the drop down the content in that area changes according to the new users ID.

I can get the jQuery to get the users ID and then send it via Ajax. However what I get back is just the number with a 0 behind it. I’ve checked and that means something went wrong. But can’t understand what since it’s returning that value…

HTML
  1. <div class="results_wrapper">
  2.       <div class="results_content">
  3.             content
  4.       </div>
  5. </div>

JQUERY
  1. jQuery('.users_with_email').on('change',function(){
  2.     var userID = jQuery(".users_with_email option:selected").val();
  3.     console.log(userID);

  4.     $.ajax({
  5.         url: post_ajax.ajax_url,
  6.         type: 'post',
  7.         cache: false,
  8.         data : {
  9.             action : 'ajax_user_results', 
  10.             userID : userID
  11.         },
  12.         beforeSend: function() {
  13.             jQuery('.results_wrapper').find( '.results_content' ).remove();
  14.         },
  15.         success: function( html ) {
  16.             jQuery('.user_id').html( html );
  17.             jQuery('.results_wrapper').load(document.URL +  ' .results_content');
  18.         }
  19.     });

  20. });
PHP
  1. add_action( 'wp_ajax_nopriv_ajax_user_results', 'ajax_user_results' );
  2. add_action( 'wp_ajax_ajax_user_results', 'ajax_user_results' );

  3. function ajax_user_results() {
  4.     $chosen_user = $_POST['userID'];
  5. }
PHP Outputted back
  1. $user_id = $chosen_user;