title: Get form & FormData objects from input element?
body: <p>So I want to fire a Javascript function every time a form 'submit' input is clicked, so I can handle the submission in Javascript.</p>
  
  <p>I have the following:</p>
  
  <pre><code>$(':submit').click(function(){
      var currentForm = $(this)[0].form;
      event.preventDefault(); //Stop default form submission
      var formData = new FormData(currentForm);
  
      $.ajax({/*Handle form submission here*/});
  });
  </code></pre>
  
  <p>I've tried a few different variations to get the currentForm, but for some reason it's always undefined?</p>
  
  <p>Is this not the correct way to get a <code>form</code> object and then convert it to a <code>FormData</code> object in Javascript? I've tried several of the solutions on <a href="https://stackoverflow.com/questions/991367/how-to-get-the-form-parent-of-an-input">How to get the form parent of an input?</a>, but none are working.</p>
  
  <p>Any ideas?</p>