I want to create an onclick event for the radio button. Here is what I have: <%= radio_button_tag ''user'', ''d_home'', :id => ''user[d_home]'', :onclick => "new Effect.SwitchOff(''apear-div''); new Effect.Fade( ''apear-div'' )" %> Now, the radio button works fine along with the other members of the group, is just doesn''t recognize the :onclick part. Anyone know what I''m missing here? Thanks, --S -- 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 -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> I want to create an onclick event for the radio button. Here is what I > have: > > <%= radio_button_tag ''user'', ''d_home'', :id => ''user[d_home]'', :onclick > => "new Effect.SwitchOff(''apear-div''); new Effect.Fade( ''apear-div'' )" > %> > > Now, the radio button works fine along with the other members of the > group, is just doesn''t recognize the :onclick part. Anyone know what I''m > missing here? Thanks,Check the APIs for radio_button and radio_button_tag, you''re not using them correctly: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M000502 http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000611 -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> I want to create an onclick event for the radio button. Here is what I > have: > > <%= radio_button_tag ''user'', ''d_home'', :id => ''user[d_home]'', :onclick > => "new Effect.SwitchOff(''apear-div''); new Effect.Fade( ''apear-div'' )" > %> > > Now, the radio button works fine along with the other members of the > group, is just doesn''t recognize the :onclick part. Anyone know what I''m > missing here? Thanks, > > --STry this, it should work (note (a) checked attribute ''true'' (b) options within ''{'' and ''}''): <%= radio_button_tag ''user'', ''d_home'', true, {:id => ''user[d_home]'', :onclick => "new Effect.SwitchOff(''apear-div''); new Effect.Fade( ''apear-div'' )"} %> Roberto Gattinoni. -- 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 -~----------~----~----~----~------~----~------~--~---