Hi - I have a view: <% content_for(:page) do %> <h1>New user</h1> <% form_for :user, @user, :url => { :action => "create" } do |form| %> <%= render :partial => ''form'', :locals => { :form => form, :genders => @genders} %> <%= submit_tag "Create" %> <%end%> <% observe_field("user_country", :function => "alert(''Element changed'')") %> <========= line of interest <%end%> which renders a partial, and includes a select with id "user_country" The html for this is: <select id="user_country" name="user[country]"><option value="1">U.S.A.</option> nothing happens. I don''t see any javascript in the html file that is generated, and no message appears when i change the country. Any ideas? thanks, Dino --~--~---------~--~----~------------~-------~--~----~ 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 changing:- <% observe_field("user_country", :function => "alert(''Element changed'')") %> to:- <%= observe_field("user_country", :function => "alert(''Element changed'')") %> Jabbslad On Feb 27, 6:28 pm, "dino d." <dinodorr...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Hi - I have a view: > > <% content_for(:page) do %> > <h1>New user</h1> > > <% form_for :user, @user, :url => { :action => "create" } do |form| %> > <%= render :partial => ''form'', :locals => { :form => form, :genders > => @genders} %> > <%= submit_tag "Create" %> > <%end%> > > <% observe_field("user_country", :function => "alert(''Element > changed'')") %> <========= line of interest > > <%end%> > > which renders a partial, and includes a select with id "user_country" > > The html for this is: > > <select id="user_country" name="user[country]"><option > value="1">U.S.A.</option> > > nothing happens. I don''t see any javascript in the html file that is > generated, and no message appears when i change the country. > > Any ideas? > > thanks, > Dino--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
<sigh> i *keep* doing this. you fixed it. thanks for the quick response. dino. On Feb 27, 1:47 pm, Jabbslad <jabbs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try changing:- > > <% observe_field("user_country", :function => "alert(''Element > changed'')") %> > > to:- > > <%= observe_field("user_country", :function => "alert(''Element > changed'')") %> > > Jabbslad > > On Feb 27, 6:28 pm, "dino d." <dinodorr...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > Hi - I have a view: > > > <% content_for(:page) do %> > > <h1>New user</h1> > > > <% form_for :user, @user, :url => { :action => "create" } do |form| %> > > <%= render :partial => ''form'', :locals => { :form => form, :genders > > => @genders} %> > > <%= submit_tag "Create" %> > > <%end%> > > > <% observe_field("user_country", :function => "alert(''Element > > changed'')") %> <========= line of interest > > > <%end%> > > > which renders a partial, and includes a select with id "user_country" > > > The html for this is: > > > <select id="user_country" name="user[country]"><option > > value="1">U.S.A.</option> > > > nothing happens. I don''t see any javascript in the html file that is > > generated, and no message appears when i change the country. > > > Any ideas? > > > thanks, > > Dino--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---