<td> <%= collection_select(:category, :id, @categories, :id, :name, options ={:prompt => "-Select categories-"}, :class=>"category_dropdown_list") %> </td> <td> <%= text_field_tag :search, params[:search], :id=>"search_form", :value=>params[:search] %> </td> <%= observe_field ''search_form'', :frequency => 0.5, :url => { :controller => ''auth_user'', :action => ''get_results'' }, :loading => "Element.show(''indicator_gif_id'')", :complete => "Element.hide(''indicator_gif_id'')", :with => "''search_text='' + escape(value)" %> I can observe the text_field, but how do I send the current selected value of the collection_select also. :with => selected item in collection_select Thanks! -- 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 -~----------~----~----~----~------~----~------~--~---
Try observe_field instead, and leave off the :with. You don''t need :with most of the time unless you''re trying to change the field. See the API. On Thu, Jul 31, 2008 at 4:19 PM, Justin To <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > <td> > <%= collection_select(:category, :id, @categories, :id, :name, > options ={:prompt => "-Select categories-"}, > :class=>"category_dropdown_list") %> > </td> > > <td> > <%= text_field_tag :search, params[:search], :id=>"search_form", > :value=>params[:search] %> > </td> > > <%= observe_field ''search_form'', > :frequency => 0.5, > :url => { :controller => ''auth_user'', > :action => ''get_results'' }, > :loading => > "Element.show(''indicator_gif_id'')", > :complete => > "Element.hide(''indicator_gif_id'')", > :with => "''search_text='' + escape(value)" > %> > > I can observe the text_field, but how do I send the current selected > value of the collection_select also. :with => selected item in > collection_select > > Thanks! > -- > 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 -~----------~----~----~----~------~----~------~--~---
On 31 Jul 2008, at 22:21, Brian Hogan wrote:> Try observe_field instead, and leave off the :with. > > You don''t need :with most of the time unless you''re trying to change > the field. See the API. > >You do need it if you want to submit more than one field. I wrote up some usages of :with a while back (http://www.spacevatican.org/2008/5/17/with-or-without-you-link_to_remote-s-mysterious-parameter ) Depending on usage observe_form may be a better fit. Fred> On Thu, Jul 31, 2008 at 4:19 PM, Justin To <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > > wrote: > > <td> > <%= collection_select(:category, :id, @categories, :id, :name, > options ={:prompt => "-Select categories-"}, > :class=>"category_dropdown_list") %> > </td> > > <td> > <%= text_field_tag :search, > params[:search], :id=>"search_form", > :value=>params[:search] %> > </td> > > <%= observe_field ''search_form'', > :frequency => 0.5, > :url => { :controller => ''auth_user'', > :action => ''get_results'' }, > :loading => > "Element.show(''indicator_gif_id'')", > :complete => > "Element.hide(''indicator_gif_id'')", > :with => "''search_text='' + escape(value)" > %> > > I can observe the text_field, but how do I send the current selected > value of the collection_select also. :with => selected item in > collection_select > > Thanks! > -- > 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 -~----------~----~----~----~------~----~------~--~---
Ooops should have phrased that differently. Fred''s explanation is great, as always. On Thu, Jul 31, 2008 at 4:34 PM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 31 Jul 2008, at 22:21, Brian Hogan wrote: > > > Try observe_field instead, and leave off the :with. > > > > You don''t need :with most of the time unless you''re trying to change > > the field. See the API. > > > > > You do need it if you want to submit more than one field. I wrote up > some usages of :with a while back ( > http://www.spacevatican.org/2008/5/17/with-or-without-you-link_to_remote-s-mysterious-parameter > ) > Depending on usage observe_form may be a better fit. > > Fred > > On Thu, Jul 31, 2008 at 4:19 PM, Justin To < > rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > > > wrote: > > > > <td> > > <%= collection_select(:category, :id, @categories, :id, :name, > > options ={:prompt => "-Select categories-"}, > > :class=>"category_dropdown_list") %> > > </td> > > > > <td> > > <%= text_field_tag :search, > > params[:search], :id=>"search_form", > > :value=>params[:search] %> > > </td> > > > > <%= observe_field ''search_form'', > > :frequency => 0.5, > > :url => { :controller => ''auth_user'', > > :action => ''get_results'' }, > > :loading => > > "Element.show(''indicator_gif_id'')", > > :complete => > > "Element.hide(''indicator_gif_id'')", > > :with => "''search_text='' + escape(value)" > > %> > > > > I can observe the text_field, but how do I send the current selected > > value of the collection_select also. :with => selected item in > > collection_select > > > > Thanks! > > -- > > 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 -~----------~----~----~----~------~----~------~--~---
I read through your article Fred, but I''m still lost trying to figure out how to pass the two values. How do I even access the values? $(''comment'').serialize() I saw that in your article...so should I give the collection_select and text_field id''s and use two of these: $(''comment'').serialize()? Thanks -- 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 -~----------~----~----~----~------~----~------~--~---
On Jul 31, 11:15 pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I read through your article Fred, but I''m still lost trying to figure > out how to pass the two values. How do I even access the values? > > $(''comment'').serialize()Will evaluate to comment=whatever_is_in_the_field_with_that_id> > I saw that in your article...so should I give the collection_select and > text_field id''s and use two of these: $(''comment'').serialize()?Yes. One of the examples given was :with => "$(''message'').serialize() + ''&'' + $(''comment'').serialize()" Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Great, got it to work. Thanks a bunch Fred! -- 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 -~----------~----~----~----~------~----~------~--~---