Hi, I added a checkbox in a form which is checked by default. Now I uncheck the checkbox and then refresh the form it displays the checkbox unchecked maintaining its state on refresh i.e unchecked. Even with textboxes the value is maintained when the page is refreshed. This problem exist only with mozilla but works fine on IE. Rohan -- 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 -~----------~----~----~----~------~----~------~--~---
Rohan Dey wrote:> Hi, > > I added a checkbox in a form which is checked by default. Now I > uncheck the checkbox and then refresh the form it displays the checkbox > unchecked maintaining its state on refresh i.e unchecked. Even with > textboxes the value is maintained when the page is refreshed. >This is not a bug but a feature. Using shift-reload resets the form. Mage --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rohan Dey wrote:> Hi, > > I added a checkbox in a form which is checked by default. Now I > uncheck the checkbox and then refresh the form it displays the checkbox > unchecked maintaining its state on refresh i.e unchecked. Even with > textboxes the value is maintained when the page is refreshed. > > > This problem exist only with mozilla but works fine on IE. > > > RohanHi Rohan, Rather than a problem, this was actively implemented by Mozilla as a convenience to the user, so that when you refresh the page, all elements'' values are stored and redisplayed when the page refreshes. You can test this by changing the name/id of an element in one of your views, then refreshing, and the value will disappear, because Mozilla will only fill in the element with the same id. I''m sure you can probably turn that functionality off, but I wouldn''t design your app around this, as any end user can have that functionality on. If you''re deadset on not keeping that information across refreshes, you can make an onLoad javascript function, something like this (untested): ''<body onLoad="document.form.each( function(item, index){item.element.each( function(subitem, subindex){ subitem.value = "";}});)">'' -- 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 -~----------~----~----~----~------~----~------~--~---