Rails 3 Submitting a form with javascript causes html response instead of a AJAX response
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 onchange parameter and the button.  Here is my code for the form:

    <% form_tag('switch_car', :method => :put, :name => "switch_car", :remote => true) do %>
    <div class="field">
        <label>Car Name:</label>
        <%= select_tag(:id, options_from_collection_for_select(active_cars, "id", "name"), :onchange => "submitForm('switch_car')", :include_blank => true)%>
    </div>
    
    <% end %>

Here is my javascript function: just a simple submit.

        <script type="text/javascript" charset="UTF-8">
    	function submitForm(formname){
    		document.switch_car.submit();
    	}
      </script>

Here is the HTML generated:

    <form accept-charset="UTF-8" action="switch_car" data-remote="true" method="post" name="switch_car"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /><input name="authenticity_token" type="hidden" value="PEbdqAoiik37lcoP4+v+dakpYxdpMkSm7Ub8eZpdF9I=" /></div><div class="field"> 
        <label>Car Name:</label> 
        <select id="id" name="id" onchange="submitForm('switch_car')"><option value=""></option><option value="9">Truck</option> 
    <option value="10">Car</option></select> 
    </div> 

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?

Thanks,
Rails 3 Submitting a form with javascript causes html response instead of a AJAX response
===

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 onchange parameter and the button.  Here is my code for the form:

    <% form_tag('switch_car', :method => :put, :name => "switch_car", :remote => true) do %>
    <div class="field">
        <label>Car Name:</label>
        <%= select_tag(:id, options_from_collection_for_select(active_cars, "id", "name"), :onchange => "submitForm('switch_car')", :include_blank => true)%>
    </div>
    
    <% end %>

Here is my javascript function: just a simple submit.

        <script type="text/javascript" charset="UTF-8">
    	function submitForm(formname){
    		document.switch_car.submit();
    	}
      </script>

Here is the HTML generated:

    <form accept-charset="UTF-8" action="switch_car" data-remote="true" method="post" name="switch_car"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /><input name="authenticity_token" type="hidden" value="PEbdqAoiik37lcoP4+v+dakpYxdpMkSm7Ub8eZpdF9I=" /></div><div class="field"> 
        <label>Car Name:</label> 
        <select id="id" name="id" onchange="submitForm('switch_car')"><option value=""></option><option value="9">Truck</option> 
    <option value="10">Car</option></select> 
    </div> 

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?

Thanks,