title: Input fields are empty after .submit jquery statement
body: <p>I'm trying to send data using an ajax call inside of a ('#form').submit call but all the inputs of the forms are empty when I didn't intend them to be. I thought it may of had something to do with the $(document).ready statement being in the incorrect location for things to work properly but I couldn't get it to work.</p>
  
  <pre><code>&lt;script&gt;
  (function($){   
      $(document).ready( function() {
          $("#success").hide();
          $("#inval_email").hide();
          $("#text_selection").on("change", function() {
              var id = $("#text_selection option:selected").attr("value");
              $("#inv_text").html($("#"+id).html());
          });
          $("#invitation_form").submit(function(e){
              var email = $('#email').val();
              var first_name = $('#first_name').val();
              var last_name = $('#last_name').val();
              var message_title = $('#message_title').val();
              var article_title = $('#article_title').val();
              var reference_location = $('#reference').val();
              var inv_text = $('#inv_text').html();
              var request;
              alert(first_name);
              e.preventDefault();
              request = $.ajax({
                  type: 'POST',
                  url: BASE_URL+"wp-content/themes/Flatter/ajax/send_invite.php",
                  dataType: "text",
                  data: { first_name: first_name, last_name: last_name, email: email, message_title: message_title, article_title: article_title, reference_location: reference_location, inv_text: inv_text },
                  success: function(data){
                      console.log(data)
                      if(data=="true"){
                          $("#invitation").hide();
                          $("#success").show();
                      }
                      if(data=="false"){
                          $("#inval_email").show();
                      }
                  }
              });
          });
      });
  })(jQuery);
  &lt;/script&gt;
  
  &lt;div class="col-md-4"&gt;
  &lt;div id="success" hidden&gt;&lt;br&gt;&lt;br&gt;Invitation sent successfully!&lt;/div&gt;
  
  &lt;div id="invitation"&gt;
  &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/br&gt;&lt;h1&gt;Invitation Form&lt;/h1&gt;
  &lt;form id = "invitation_form"&gt;
  First Name:&lt;input id="first_name" type="text" name="first_name" required&gt;
  Last Name:&lt;input id="last_name" type="text" name="last_name" required&gt;
  Email Address:&lt;input id="email" type="text" name="email" required&gt;
  Message Title:&lt;input id="message_title" type="text" name="message_title" required&gt;
  Article Title:&lt;input id="article_title" type="text" name="article_title" required&gt;
  Reference Location:&lt;input id="reference" type="text" name="reference" required&gt;
  Message:&lt;textarea id="inv_text" style="resize: none" rows="10" placeholder="Select invitation type..." readonly required&gt;&lt;/textarea&gt;
  Invitation Type:
      &lt;select id="text_selection"&gt;
          &lt;option value="empty_field"&gt;&lt;/option&gt;
          &lt;option value="community_inv_text"&gt;Community Invitation&lt;/option&gt;
          &lt;option value="content_submission_inv" &gt;Content Submission Invitation&lt;/option&gt;
          &lt;option value="individual_inv"&gt;Individual Invitation&lt;/option&gt;
          &lt;option value="content_submission_and_individual_inv"&gt;Content Submission and Individual Invitation&lt;/option&gt;
          &lt;option value="contributor_content_submission_inv"&gt;Contributor Content Submission Invitation&lt;/option&gt;
      &lt;/select&gt;
      &lt;input id="submit_inv" type="submit" value="Invite"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I would greatly appreciate some help in this matter. The point of this code is to collect information from the user and send the data to another file so it can be processed. Thanks for any help in advance.</p>