This project is archived and is in readonly mode.

#5009 ✓resolved
Alex Le

unobtrusive js: form_for :remote => true doesn't work in IE

Reported by Alex Le | June 30th, 2010 @ 01:33 AM

I've been working with Rails 3 beta 4 for a while on the Mac, then I switched to my PC laptop to test the site out. In IE (6,7, and 8), all the Ajax forms stopped working (it got me freak out a bit). After debugging the code for a while, it turned out that the even with the :remote => true option, IE just does not support event bubbling for the submit event. The comment in rails.js (around line 93) is

// TODO: I don't think submit bubbles in IE
$(document.body).observe("submit", function(event) {...

With :remote => true doesn't work in IE, this is a huge issue and I don't think Rails can be shipped without this feature fully working.

My thinking is that specifically for the "forms_for :remote => true", the onSubmit event of the form need to explicitly call the handleRemote() method in the rails.js file so that the event can be captured, processed, and stopped appropriately. It's not a very "unobtrusive" solution, but I don't see away to work around this issue. My knowledge of Rails internal stuff is not that great yet, but I will take a look into the actionpack code to see if I can find a work around.

Is there anyone who's also looking into this issue?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages