hi: I have 2 radio buttons that are just interface elements: radio_button_tag. I don''t really care about their method or object, I just want to fire some login on the page based on whether or not they''re clicked. Problem is, they''re not behaving together, meaning I can have them both be checked at the same time, which is a no-no. Is this a limitation of radio_button_tag becuase it''s not hooked up to a form. Here''s my radio button code in my view: <%= radio_button_tag ('''', 0, checked = false, options = {:onclick => ""}) %> <%= radio_button_tag ('''', 1, checked = false, options = {:onclick => ""}) %> What am I doing wrong? I just want them to perform as normal radio buttons and then use their "onclick" option to fire off some javascript. Thanks very much in advance for your help! Mike -- 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 -~----------~----~----~----~------~----~------~--~---
Mike Dershowitz wrote:> hi: > > I have 2 radio buttons that are just interface elements: > radio_button_tag. I don''t really care about their method or object, I > just want to fire some login on the page based on whether or not they''re > clicked. Problem is, they''re not behaving together, meaning I can have > them both be checked at the same time, which is a no-no. Is this a > limitation of radio_button_tag becuase it''s not hooked up to a form. > Here''s my radio button code in my view: > > <%= radio_button_tag ('''', 0, checked = false, options = {:onclick => > ""}) %> > <%= radio_button_tag ('''', 1, checked = false, options = {:onclick => > ""}) %> > > What am I doing wrong? I just want them to perform as normal radio > buttons and then use their "onclick" option to fire off some javascript. > > Thanks very much in advance for your help! > > MikeThe name of both radio buttons is '''', an empty string. The browser will only allow one selection based on the radio buttons name. I think the browser is getting confused by the lack of a name. So give that first parameter a real value, and it should work fine. -- 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 -~----------~----~----~----~------~----~------~--~---
Alex Wayne wrote:> Mike Dershowitz wrote: >> hi: >> >> I have 2 radio buttons that are just interface elements: >> radio_button_tag. I don''t really care about their method or object, I >> just want to fire some login on the page based on whether or not they''re >> clicked. Problem is, they''re not behaving together, meaning I can have >> them both be checked at the same time, which is a no-no. Is this a >> limitation of radio_button_tag becuase it''s not hooked up to a form. >> Here''s my radio button code in my view: >>>> >> What am I doing wrong? I just want them to perform as normal radio >> buttons and then use their "onclick" option to fire off some javascript. >> >> Thanks very much in advance for your help! >> >> Mike > > The name of both radio buttons is '''', an empty string. The browser will > only allow one selection based on the radio buttons name. I think the > browser is getting confused by the lack of a name. > > So give that first parameter a real value, and it should work fine.Hi Alex: Thanks so much for your reply. I had it this way:>> <%= radio_button_tag (''duedate'', 0, checked = false, options = {:onclick => >> ""}) %> >> <%= radio_button_tag (''noduedate'', 1, checked = false, options = {:onclick => >> ""}) %>And it still didn''t work. but that''s because there aren''t any values for these two things, no methods, because they''re really not supposed to be hooked up to anything. Any further ideas? Thanks again! Mike -- 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 -~----------~----~----~----~------~----~------~--~---
Mike Dershowitz wrote:> Alex Wayne wrote: >> Mike Dershowitz wrote: >>> hi: >>> >>> I have 2 radio buttons that are just interface elements:>>> Mike >> The name of both radio buttons is '''', an empty string. The browser will >> only allow one selection based on the radio buttons name. I think the >> browser is getting confused by the lack of a name. >> >> So give that first parameter a real value, and it should work fine. > > Hi Alex: > > Thanks so much for your reply. I had it this way: > >>> <%= radio_button_tag (''duedate'', 0, checked = false, options = {:onclick => >>> ""}) %> >>> <%= radio_button_tag (''noduedate'', 1, checked = false, options = {:onclick => >>> ""}) %> > > And it still didn''t work. but that''s because there aren''t any values > for these two things, no methods, because they''re really not supposed to > be hooked up to anything. >Pretty sure that needs to be <%= radio_button_tag (''duedate'', 0, checked = false, options = {:onclick => ""}) %> <%= radio_button_tag (''duedate'', 1, checked = false, options = {:onclick =>""}) %> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Benjamin Ritcey wrote:> Mike Dershowitz wrote: >> Alex Wayne wrote: >>> Mike Dershowitz wrote: >>>> hi: >>>> >>>> I have 2 radio buttons that are just interface elements: > >> >>>> <%= radio_button_tag (''duedate'', 0, checked = false, options = {:onclick => >>>> ""}) %> >>>> <%= radio_button_tag (''noduedate'', 1, checked = false, options = {:onclick => >>>> ""}) %> >> >> And it still didn''t work. but that''s because there aren''t any values >> for these two things, no methods, because they''re really not supposed to >> be hooked up to anything. >> > > Pretty sure that needs to be > > <%= radio_button_tag (''duedate'', 0, checked = false, options = {:onclick > => ""}) %> >Hi: yes, I''ve tried that and that still doesn''t work. Do these need to be in a form_for or something like that? Thanks again for any help you can provide! Mike> <%= radio_button_tag (''duedate'', 1, checked = false, options = {:onclick > =>""}) %>-- 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 -~----------~----~----~----~------~----~------~--~---