Hi, I''ve got some Ajax stuff that shows more or less of a complex form based on a radio button selection. A "radio_handler" controller action is the action for a form handler. Some seemingly simple "replace_html" fires as a result of different radio buttons being chosen (which should then show more or less of the form). This all works just great on Mac Safari and Mac Firefox. On Windows IE6, the rendering just doesn''t happen. No errors in the log, just the replace_html rendering just doesn''t change what''s showing on the screen. Anybody seen something like this in IE and have a solution? thanks, jp -- 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 -~----------~----~----~----~------~----~------~--~---
Jeff Pritchard wrote:> A "radio_handler" controller action is the > action for a form handler.correction... A "radio_handler" action is the action for an "observe_form" observer. thanks, jp -- 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 -~----------~----~----~----~------~----~------~--~---
Jeff, I was doing exactly the same thing that you are doing a while back (radio buttons showing/hiding form elements) and I ran into the same problem. I wrote the following note to myself about the problem: <note> The javascript generated by observe_field does not work as expected with (at least) IE 6.0. It exhibits the confusing behavior of sending an XHR with value set to an empty string. </note> Its something to do with the way IE''s non-standard event model deals with radio buttons. I can''t tell you what exactly what the issue is, my solution to this problem was to use remote_function(), like so: <select onchange="<%remote_function(:url=>{:action=>:ajax_action_that_replaces_stuff}, :with=>''Form.Element.serialize(this)'') %>"> This is better than observe_form anyway, it''s event driven rather than the client polling the server. After thinking about it I really dont see any use for observe_form or observe_field at all . . it seems to me that there is always an equivalent event-driven way to do it like the one above. Anybody disagree? Happy coding! Blake Miller On Mar 6, 7:22 pm, Jeff Pritchard <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> JeffPritchardwrote: > > A "radio_handler" controller action is the > > action for a form handler. > > correction... > A "radio_handler" action is the action for an "observe_form" observer. > > thanks, > jp > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
> This is better than observe_form anyway, it''s event driven rather than > the client polling the server. After thinking about it I really dont > see any use for observe_form or observe_field at all . . it seems to > me that there is always an equivalent event-driven way to do it like > the one above. Anybody disagree? >I may be wrong, but i would say if you don''t pass a frequency parameter to observe_field (never used it with observe_form, so no idea) it defaults to event-driven behaviour. It will periodically poll only if you explicitily ask for it. regards, javier ramirez -- -------- Estamos de estreno... si necesitas llevar el control de tus gastos visita http://www.gastosgem.com !!Es gratis!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Blake Miller wrote:> Jeff, > > <select onchange="<%> remote_function(:url=>{:action=>:ajax_action_that_replaces_stuff}, > :with=>''Form.Element.serialize(this)'') > %>"> > > Happy coding! > Blake Miller >Thanks very much Blake. I agree with you on observe form. I''ve wound up taking them out and replacing them with event driven approach in other places before. I guess maybe I''ll just avoid them completely now. On the surface it seems like the easy way to watch three separate items with one thing...but there are always problems with it. And the extra server churning pretty much puts the first nail in its coffin. cheers, jp -- 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 -~----------~----~----~----~------~----~------~--~---