I''m trying to submit a form_remote_tag using javascript instead of an input button. However, when I do this the ajax doesn''t fire on submit. Is there a way to do this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
try sth. like this:
<% form_tag :id => "search" do -%>
<%= text_field_tag(''search_field'', params[:query],
:autocomplete
=> "on" ) %>
<% end -%>
<%= observe_field ''search_field'', :frequency => 1,
:update => "activities",
:url => { :controller => "your_controller",
:action => "search"
},
:with => "query" %>
this will send a request to your search-method every time the user
typed sth. into the search_field.
hope this helps! smn
On Jul 10, 8:31 pm, idledaylight
<idledayli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''m trying to submit a form_remote_tag using javascript instead of
an
> input button. However, when I do this the ajax doesn''t fire on
submit.
> Is there a way to do this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
one more thing: in my above example i used :update => "activities" change "activities" to whatever the id of the element (div, table....) is that you want to update good luck! smn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---