In my rails app I have a remote form that looks something like this for example:
<%= form_tag some_path, :method => :get, :id => 'my-form', :remote => true do %>
<%= text_field_tag :search, params[:search], :id => 'search-field' %>
<%= submit_tag 'Go' %>
<% end %>
Now i would like to submit this form via javascript and trigger all rails remote form callbacks. So far i have tried a few things but nothing seems to be working.
Things i have tried:
$('#my-form').trigger('onsubmit')
$.rails.callFormSubmitBindings( $('#search-form') )
but no luck so far. Any ideas?
$("#my-form").submit()
? Does it fire the necessary callbacks? I know I've used similar in my own code. – Amanda