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

**URL:** <https://www.ruby-forum.com/t/ajax-and-ie6-is-there-some-sort-of-trick/87953>\
**Category:** Rails\
**Created:** [March 7, 2007, 3:18am UTC](https://www.ruby-forum.com/t/ajax-and-ie6-is-there-some-sort-of-trick/87953 "2007-03-07T03:18:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [March 7, 2007, 3:18am UTC](https://www.ruby-forum.com/t/ajax-and-ie6-is-there-some-sort-of-trick/87953/1 "2007-03-07T03:18:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [March 7, 2007, 3:22am UTC](https://www.ruby-forum.com/t/ajax-and-ie6-is-there-some-sort-of-trick/87953/2 "2007-03-07T03:22:50Z")

</div>

Jeff P. 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

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [March 7, 2007, 8:31am UTC](https://www.ruby-forum.com/t/ajax-and-ie6-is-there-some-sort-of-trick/87953/3 "2007-03-07T08:31:26Z")

</div>

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:

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.

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:

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 M.

On Mar 6, 7:22 pm, Jeff P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [March 7, 2007, 9:16am UTC](https://www.ruby-forum.com/t/ajax-and-ie6-is-there-some-sort-of-trick/87953/4 "2007-03-07T09:16:30Z")

</div>

> 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](http://www.gastosgem.com) !!Es gratis!!

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [March 7, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/ajax-and-ie6-is-there-some-sort-of-trick/87953/5 "2007-03-07T16:38:24Z")

</div>

Blake M. wrote:

> Jeff,
> 
> Happy coding!  
> Blake M.

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
