title: Rails 3 Submitting a form with Javascript causes html response instead of a AJAX response
body: <p>When I submit a form with Javascript I get the html response, it is like it ignores the remote true parameter.  If I submit the form with the submit button it does the AJAX and updates the page elements requested.  So the only difference in the code is the presence of the <code>onchange</code> parameter and the button.  Here is my code for the form:</p>
  <pre><code>&lt;% form_tag('switch_car', :method =&gt; :put, :name =&gt; &quot;switch_car&quot;, :remote =&gt; true) do %&gt;
  &lt;div class=&quot;field&quot;&gt;
      &lt;label&gt;Car Name:&lt;/label&gt;
      &lt;%= select_tag(:id, options_from_collection_for_select(active_cars, &quot;id&quot;, &quot;name&quot;), :onchange =&gt; &quot;submitForm('switch_car')&quot;, :include_blank =&gt; true)%&gt;
  &lt;/div&gt;
  
  &lt;% end %&gt;
  </code></pre>
  <p>Here is my Javascript function: just a simple submit.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot; charset=&quot;UTF-8&quot;&gt;
  function submitForm(formname){
      document.switch_car.submit();
  }
  &lt;/script&gt;
  </code></pre>
  <p>Here is the HTML generated:</p>
  <pre><code>&lt;form accept-charset=&quot;UTF-8&quot; action=&quot;switch_car&quot; data-remote=&quot;true&quot; method=&quot;post&quot; name=&quot;switch_car&quot;&gt;&lt;div style=&quot;margin:0;padding:0;display:inline&quot;&gt;&lt;input name=&quot;utf8&quot; type=&quot;hidden&quot; value=&quot;&amp;#x2713;&quot; /&gt;&lt;input name=&quot;_method&quot; type=&quot;hidden&quot; value=&quot;put&quot; /&gt;&lt;input name=&quot;authenticity_token&quot; type=&quot;hidden&quot; value=&quot;PEbdqAoiik37lcoP4+v+dakpYxdpMkSm7Ub8eZpdF9I=&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;field&quot;&gt; 
      &lt;label&gt;Car Name:&lt;/label&gt; 
      &lt;select id=&quot;id&quot; name=&quot;id&quot; onchange=&quot;submitForm('switch_car')&quot;&gt;&lt;option value=&quot;&quot;&gt;&lt;/option&gt;&lt;option value=&quot;9&quot;&gt;Truck&lt;/option&gt; 
  &lt;option value=&quot;10&quot;&gt;Car&lt;/option&gt;&lt;/select&gt; 
  &lt;/div&gt; 
  </code></pre>
  <p>Anybody know why the Javascript submit causes a different result than the button on the same form?  If so can I get the Javascript submit to work with an Ajax result?</p>