Ajax and IE6 - is there some sort of "trick"?

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

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