I have a form observer wich posts back a form correctly, however, i need to know which item caused the form observer to trigger and what the value of that field is. At the moment i get the whole form back but dont know which field triggered the call back. <%= observe_form(''test'', :on => ''click'', :url => {:controller => ''test'', :action => ''test''}, :before => "Element.show(''imgSpinner'')", :success => "Element.hide(''imgSpinner'')") %> JB -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
How many fields are you monitoring in this form? It may be worth while to have it using observe_field rather than observe_form, because that should be able to pass in what the name of the element is that triggered it. On Mon, May 19, 2008 at 6:58 PM, John Butler < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I have a form observer wich posts back a form correctly, however, i need > to know which item caused the form observer to trigger and what the > value of that field is. At the moment i get the whole form back but > dont know which field triggered the call back. > > <%= observe_form(''test'', > :on => ''click'', > :url => {:controller => ''test'', :action => ''test''}, > :before => "Element.show(''imgSpinner'')", > :success => "Element.hide(''imgSpinner'')") %> > > JB > -- > Posted via http://www.ruby-forum.com/. > > > >-- Appreciated my help? Reccommend me on Working With Rails http://workingwithrails.com/person/11030-ryan-bigg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ye thats what i would normally do but im having an issue where the field observer will only work once and then wont trigger again. Ive found away around that issue but was wondering if there was an easy way to submit the form but als the element that has triggered the form event. Ryan Bigg wrote:> How many fields are you monitoring in this form? It may be worth while > to > have it using observe_field rather than observe_form, because that > should be > able to pass in what the name of the element is that triggered it. > > On Mon, May 19, 2008 at 6:58 PM, John Butler < > rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> :success => "Element.hide(''imgSpinner'')") %> >> >> JB >> -- >> Posted via http://www.ruby-forum.com/. >> >> > >> > > > -- > Appreciated my help? > Reccommend me on Working With Rails > http://workingwithrails.com/person/11030-ryan-bigg-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---