KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-29 17:12 UTC
If only I could get ''observe_field'' to fire?
I''ve been programming in Rails for about a year and have made great progress. If I could just fire an event inside a form and respond with code, I could go much further. I''ve created an example using the observe_field javascript applet and can''t get it to respond. Here''s a very simple example where the user is selecting from a SELECT statement and once this hurdle is jumped the observe_field should fire by showing all the params. <p><b>Category:</b><br> <select id="ecat_id" name="eitem[ecat_id]"> <% @ecats.each do |ecat| %> <option value="<%= ecat.id %>" <%= '' selected'' if ecat.id == @eitem.ecat_id %>> <%= ecat.description %> </option> <% end %> </select></p> <%= observe_field "ecat_id", :update => ''params.inspect'' %> I don''t seem to be getting the consolidated list of this forum anymore and would appreciate a reply to my email address below. Thank you, Kathleen KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/29/07, KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''ve been programming in Rails for about a year and have made great > progress. If I could just fire an event inside a form and respond with > code, I could go much further. > I''ve created an example using the observe_field javascript applet and > can''t get it to respond. Here''s a very simple example where the user > is selecting from a SELECT statement and once this hurdle is jumped > the observe_field should fire by showing all the params. > <p><b>Category:</b><br> > <select id="ecat_id" name="eitem[ecat_id]"> > <% @ecats.each do |ecat| %> > <option value="<%= ecat.id %>" > <%= '' selected'' if ecat.id == @eitem.ecat_id %>> > <%= ecat.description %> > </option> > <% end %> > </select></p> > > <%= observe_field "ecat_id", > :update => ''params.inspect'' %>You haven''t given a :url or :function option. One or the other is required. In a situation like this, always look at the generated JavaScript to make sure it''s generating what you expect. Also, use Firebug so you can trace XHR and see if it fires and if any errors are returned.> I don''t seem to be getting the consolidated list of this forum anymore > and would appreciate a reply to my email address below.Um, no. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---