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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…