I have the following radio button in my code: <%= radio_button_tag("single_or_collection", "single", checked true, options = {:id => "isSingle"}) %>Single <%= radio_button_tag("single_or_collection", "collection", checked false, options = {:id => "isCollection"}) %>Collection The "single" button is checked correctly on initial page load. If however I check "collection" using the mouse and then reload the page, "collection" is still checked. I''d like "single" to be checked whenever this page is loaded. Am I doing something wrong? Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
augustlilleaas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-20 13:38 UTC
Re: radio_button_tag - not checking as expected
This is the way browsers work. When you refresh the page, you most likely don''t want all the stuff you input to the form to be destroyed, so the browser keeps it. If you do a shift-refresh (empties cache and loads the page again), the form will be back at it''s empty default state. On Jan 20, 12:01 am, "Lee" <lee_longm...-/E1597aS9LT10XsdtD+oqA@public.gmane.org> wrote:> I have the following radio button in my code: > > <%= radio_button_tag("single_or_collection", "single", checked > true, options = {:id => "isSingle"}) %>Single > <%= radio_button_tag("single_or_collection", "collection", checked > false, options = {:id => "isCollection"}) %>Collection > > The "single" button is checked correctly on initial page load. > > If however I check "collection" using the mouse and then reload the > page, "collection" is still checked. > > I''d like "single" to be checked whenever this page is loaded. Am I > doing something wrong? > > Thanks.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---