Reputation: 5403
I have a form that's wrapped in a div with id content
:
<div id="content">
<%= render :partial => 'shared/signup' %>
</div>
shared/_signup.html.erb contains:
<%= form_tag sign_me_up_path, :remote => true do %>
...
<% end %>
If the user submits the form and there's errors, I render create.js.erb which contains only:
$("#content").html("<%= escape_javascript(render :partial => 'shared/signup') %>");
With internet explorer this simply removes all of the content in #content
, but it works great in all other browsers. I'd appreciate any help / insight.
Upvotes: 3
Views: 824
Reputation: 7123
I'm using the same pattern- remote form submission, javascript response which renders a partial and populates the html of a div using Jquery (1.4.4). I saw the same behavior in IE, but it turned out it was due to a typo in the HTML partial.
The other browsers were just nicer about handling an unclosed span tag. I suspect you've got a similar issue- validate the rendered HTML of your partial.
Upvotes: 2
Reputation: 2510
This may be what you're looking for:
http://www.alfajango.com/blog/problems-with-rails-3-remote-links-and-forms-using-jquery-live-in-ie/
Upvotes: -1