I want to use select_tag helper but how to set a onclick function? where should I define this function? 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 don''t think IE supports onlick on the select tag. You may want to look at setting the onclick for the options tags inside the select. On Dec 25, 10:26 pm, Zhao Yi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I want to use select_tag helper but how to set a onclick function? where > should I define this function? > > thanks. > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan wrote:> I don''t think IE supports onlick on the select tag. You may want to > look at setting the onclick for the options tags inside the select.Hi Ryan, Can I let onclick refer to a function defined in the controller? -- 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 -~----------~----~----~----~------~----~------~--~---
Zhao Yi wrote:> Can I let onclick refer to a function defined in the controller?In HTML it''s: onclick=''Ajax.Request(...)'' In Ruby that''s :onclick => ''Ajax.Request(...)'', natch. To get the ... part, write remote_function or link_to_remote into a web page and view its source. That will show you how to pack the Request arguments. -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> In HTML it''s: > > onclick=''Ajax.Request(...)'' > > In Ruby that''s :onclick => ''Ajax.Request(...)'', natch. > > To get the ... part, write remote_function or link_to_remote into a web > page and > view its source. That will show you how to pack the Request arguments. > > -- > PhlipSorry I am new to rails and don''t understand your comments. I have a select box and I want whenever its value changed, other text field value will change accordingly. Could you please give me an example for this? 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 -~----------~----~----~----~------~----~------~--~---
Zhao, Take a look at the excelent screencasts by Ryan Bates (specially episode #88 and others on AJAX, RJS and JQuery) at: http://railscasts.com/ Cheers, Sazima On Dec 26, 6:04 am, Zhao Yi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Phlip wrote: > > In HTML it''s: > > > onclick=''Ajax.Request(...)'' > > > In Ruby that''s :onclick => ''Ajax.Request(...)'', natch. > > > To get the ... part, write remote_function or link_to_remote into a web > > page and > > view its source. That will show you how to pack the Request arguments. > > > -- > > Phlip > > Sorry I am new to rails and don''t understand your comments. > I have a select box and I want whenever its value changed, other text > field value will change accordingly. Could you please give me an example > for this? > > thanks. > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---