title: AJAX call doesn't seem to POST any data
body: <p>Im trying to send data to a codeigniter function to validate all fields are filled and the email is OK.
  Yet it seems like the ajax call isn't sending anything at all..</p>
  <p>I have tried changing the order, and how many values are send to the function, yet none seem to change the fact that it always gives a empty string in response.</p>
  <p>NOTE: i also tried replacing the &quot;click&quot; for submit.</p>
  <p>ajax code:</p>
  <pre><code>$('#appointment_form_submit').click(function(e){
      e.preventDefault();
  
      $.ajax({
          url: 'afspraken/appointment_validation',
          type: 'POST',
          data: {
              respondee_name: $('#InputName').val(), 
              respondee_email: $('#InputEmail').val(),
              respondee_phone: $('#InputTel').val(),
              respondee_date: $('#startDate').val(),
              respondee_time: $('#select_timestamp').val(),
              respondee_appointment: $('#select_appointment').val()
          },
          success: function(data) {
              // check if data is empty
              if(data.trim() == &quot;&quot;){
                  console.log('no errors');
              } else {
                  console.log(data);
                  // get data
                  var err = JSON.parse(data);
                  $('#errors_display_respondee_name').html(err.respondee_name_error);
                  $('#errors_display_respondee_email').html(err.respondee_email_error);
                  $('#errors_display_respondee_phone').html(err.respondee_phone_error);
                  $('#errors_display_respondee_date').html(err.respondee_date_error);
                  $('#errors_display_respondee_time').html(err.respondee_time_error);
                  $('#errors_display_respondee_appointment').html(err.respondee_appointment_error);
              }
          },
          error: function(XMLHttpRequest, textStatus, errorThrown) {
              console.log(XMLHttpRequest.responseText);
              console.log(textStatus);
              console.log(errorThrown);
          }
      });
      return false;
  });
  </code></pre>
  <p>Codeigniter function:</p>
  <pre><code>function appointment_validation(){
      // set validation rule
      $this-&gt;form_validation-&gt;set_rules('respondee_name', 'Naam', 'required');
      $this-&gt;form_validation-&gt;set_rules('respondee_email', 'E-mailadres', 'trim|required|valid_email');
      $this-&gt;form_validation-&gt;set_rules('respondee_phone', 'Telefoonnummer', 'required');
      $this-&gt;form_validation-&gt;set_rules('respondee_date', 'Datum', 'required');
      $this-&gt;form_validation-&gt;set_rules('respondee_time', 'Tijd', 'required');
      $this-&gt;form_validation-&gt;set_rules('respondee_appointment', 'Hoe', 'required');
      // fun validation
      if ($this-&gt;form_validation-&gt;run() == FALSE){
          // validation fails
          $vals = [
              'error' =&gt; true,
              'respondee_name_error' =&gt; form_error('respondee_gender'),
              'respondee_email_error' =&gt; form_error('respondee_firstName'),
              'respondee_phone_error' =&gt; form_error('respondee_lastName'),
              'respondee_date_error' =&gt; form_error('respondee_emailAddress'),
              'respondee_time_error' =&gt; form_error('respondee_emailAddress'),
              'respondee_appointment_error' =&gt; form_error('respondee_emailAddress')
          ];
          echo json_encode($vals);
      }
  }
  </code></pre>