title: With Rails UJS, how to submit a remote form from a function
body: <p>I'm using Rails UJS. I have a form setup to do a remote submit like so:</p>
  
  <pre><code>&lt;form accept-charset="UTF-8" action="/subscriptions" class="new_subscription form-horizontal" id="new_subscription" data-remote="true" data-type="json" method="POST"&gt;
  </code></pre>
  
  <p>I'm trying to find a way to submit this form from a JavaScript function. I've tried: </p>
  
  <pre><code>var form$ = $("#new_subscription");
  form$.get(0).submit();
  </code></pre>
  
  <p>but the problem with this is that it submits the form w/o the remote, it posts to the server and refreshes the page. Any idea why that is? Is there a different way to submit a remote form?</p>
  
  <p>Thanks</p>