On Nov 13, 2009, at 9:04 AM, bill walton wrote:
> > Greetings! > > I've got a select field (simple Yes | No) in a form and an > observe_field > removing / inserting a <div> via RJS when the select field changes. > > If the user reloads the page the value of the select field changes, > but > not the display. That is, the default is 'Yes'. The user changes the > value to 'No' and then hits the refresh button. When the page > finishes > reloading and I look at the source via Firebug, the selected option is > 'Yes', but the displayed value of the select box is still 'No'. > > Anybody know why this is? Or what I might do to work around it? > > The problem it's causing me is that when the user changes the > displayed > value to 'No' it removes the <div> below the select from the page. > When > they reload the page, the <div> is now displayed as per the original > page load. If the user changes the select back to 'Yes', the RJS > renders a second <div>. I can't just toggle the display of the <div>. > It needs to be removed from the page. Firefox does this to me on normal selects... if you reload Firefox will keep whatever you selected instead of "resetting" the select field. If instead of reloading I go up into the address bar and hit return (to trigger a 'new' load) then it resets itself. I don't know if there is a work around other than to forcibly move things around using javascript based on what they did... -philip --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

