# RJS error in internet explorer

**URL:** <https://www.ruby-forum.com/t/rjs-error-in-internet-explorer/74759>\
**Category:** Rails\
**Created:** [November 7, 2006, 10:55am UTC](https://www.ruby-forum.com/t/rjs-error-in-internet-explorer/74759 "2006-11-07T10:55:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stewbawka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewbawka](https://www.ruby-forum.com/u/stewbawka)\
**Post date:** [November 7, 2006, 10:55am UTC](https://www.ruby-forum.com/t/rjs-error-in-internet-explorer/74759/1 "2006-11-07T10:55:22Z")

</div>

hey all,

got a rails app i’m finishing up. i have a little ajax on one of my  
pages where the person can choose a doctor from a drop down list and if  
the doctor isn’t there they can click a link which blinds down a little  
form to add a doctor. after they submit that mini-form the page updates  
the div which houses the drop-down so the doctor shows up. works very  
nicely IN FIREFOX. I hate IE, i get an “RJS error: [object error]” with  
IE 6 and IE 7. i’d paste the error, but can’t copy the text in the damn  
alert box.

i’ve googled this and i get a lot of results with people getting this  
error when adding rows to tables… this doesn’t do that, but it does  
insert an option to the drop down.

here’s my rjs template:

unless params.has\_key?(“commit”)  
if params[:cancel]  
page[:phys\_form].visual\_effect :blind\_up  
else  
page[:phys\_form].replace\_html :partial =\> ‘phys\_form’  
page[:phys\_form].visual\_effect :blind\_down  
end  
else  
if @doctor.save  
page.insert\_html :bottom, ‘doctor\_id’, ‘’ + @doctor.name + ‘’  
page[:phys\_form].visual\_effect :blind\_up

else  
page[:phys\_form].replace\_html :partial =\> ‘phys\_form’  
end  
end

any help will be majorly appreciated. thanks in advance!

stuart

---

<div class="post-metadata">

**Author:** ![stewbawka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewbawka](https://www.ruby-forum.com/u/stewbawka)\
**Post date:** [November 7, 2006, 10:55am UTC](https://www.ruby-forum.com/t/rjs-error-in-internet-explorer/74759/2 "2006-11-07T10:55:41Z")

</div>

stewbawka wrote:

> ```
> page[:phys_form].replace_html :partial => 'phys_form'
> 
> ```
> 
> end  
> end
> 
> any help will be majorly appreciated. thanks in advance!
> 
> stuart

Try re-rendering and replacing the entire select control. Apparently  
IE chokes when you modify the inner\_html of a select control.

\_Kevin

---

<div class="post-metadata">

**Author:** ![stewbawka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewbawka](https://www.ruby-forum.com/u/stewbawka)\
**Post date:** [November 7, 2006, 10:56am UTC](https://www.ruby-forum.com/t/rjs-error-in-internet-explorer/74759/3 "2006-11-07T10:56:15Z")

</div>

thanks for taking the time to try to help me out… i’ll try this out  
tomorrow.

---

<div class="post-metadata">

**Author:** ![stewbawka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewbawka](https://www.ruby-forum.com/u/stewbawka)\
**Post date:** [November 7, 2006, 10:58am UTC](https://www.ruby-forum.com/t/rjs-error-in-internet-explorer/74759/4 "2006-11-07T10:58:58Z")

</div>

just tried putting the dropdown in a div and replacing the whole div  
rather than inserting another option to the bottom… still no luck. but  
i’ve realized now that its not at all the list option insertion that’s  
messing it up… it fails way before that. it actually fails when i  
click the “Add doctor” link when its trying to replace the html in the  
div that houses the form to add doctors and blinds it up so its  
visible… IE is basically failing at the simplest ajax things right  
now. Grrrrr

any advice? i really need to get this working in IE and i don’t want to  
have to make a separate page for adding doctors. Microsoft SUCKS

---

<div class="post-metadata">

**Author:** ![stewbawka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewbawka](https://www.ruby-forum.com/u/stewbawka)\
**Post date:** [March 29, 2007, 3:01pm UTC](https://www.ruby-forum.com/t/rjs-error-in-internet-explorer/74759/5 "2007-03-29T15:01:40Z")

</div>

Damien Le berrigaud wrote:

> I’ve got the same problem
> 
> I have a form with a checkable list of items.  
> Each item can be edit which creates a form inside the first one.  
> When validating the item editing form, I am not able to modify a div to  
> display error messages. The div is inside the second form.
> 
> I have tested the same code and removing the first form. It works. IE  
> doesn’t seem to like modifying something like that: form \> form \> div
> 
> Still Looking for a way to avoid the problem.

I just solved the problem by moving the div in which I display my erro  
messages outside of the second form. I still need to make it look like  
it is still in the same place, but the Ajax stuff works now.

---

<div class="post-metadata">

**Author:** ![stewbawka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewbawka](https://www.ruby-forum.com/u/stewbawka)\
**Post date:** [March 29, 2007, 12:12pm UTC](https://www.ruby-forum.com/t/rjs-error-in-internet-explorer/74759/6 "2007-03-29T12:12:54Z")

</div>

I’ve got the same problem

I have a form with a checkable list of items.  
Each item can be edit which creates a form inside the first one.  
When validating the item editing form, I am not able to modify a div to  
display error messages. The div is inside the second form.

I have tested the same code and removing the first form. It works. IE  
doesn’t seem to like modifying something like that: form \> form \> div

Still Looking for a way to avoid the problem.
