# Remote\_form\_for works only in IE, not Firefox

**URL:** <https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027>\
**Category:** Rails\
**Created:** [April 26, 2007, 6:27pm UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027 "2007-04-26T18:27:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 26, 2007, 6:27pm UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/1 "2007-04-26T18:27:23Z")

</div>

Hi, I’ve a strange problem - When the params content of the controller  
is different (and incomplete) when posted by Firefox.

\<% remote\_form\_for(:article, @article, :url =\> { :action =\> :edit },  
:html =\> {:method=\> :POST} ) do |f| %\>  
\<%= f.select(:rubrique\_id, arbre\_select(@rubriques)) %\>  
\<%= f.text\_field :titre, :size =\> 64 %\>  
\<%= f.text\_area :resume, {:cols =\> 60, :rows =\>5} %\>  
\<%= f.text\_area :contenu, {:cols =\> 60, :rows =\>20, :class =\>  
‘mceEditor’ } %\>  
\<%= f.check\_box :publie %\>  
\<%= text\_field\_tag :tags, @article.tag\_list, :size =\> 64, :autocomplete  
=\> ‘off’ %\>

 \<%= auto\_complete\_field('tags', :url =\> url\_for(:controller =\> 'admin\_tags', :action =\> 'auto\_complete'), :min\_chars =\> 3, :tokens =\> ',') %\> \<%= link\_to('Annuler', :action =\> 'index') %\> \<%= submit\_tag 'Enregistrer' %\> \<% end %\>

pp params output with Firefox is  
{“action”=\>“edit”, “id”=\>“5”, “controller”=\>“admin\_articles”}

All the fields of the form are omited

pp params output with IE is  
{“article”=\>  
{“modifie\_par”=\>“1”,  
“rubrique\_id”=\>“1”,  
“publie”=\>“1”,  
“id”=\>“5”,  
“resume”=\>"",  
“titre”=\>“Bienvenue !!”,  
“contenu”=\>""},  
“commit”=\>“Enregistrer”,  
“tags”=\>"",  
“action”=\>“edit”,  
“id”=\>“5”,  
“controller”=\>“admin\_articles”}

What’s wrong ??

Thanks

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 27, 2007, 1:52pm UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/2 "2007-04-27T13:52:09Z")

</div>

Any idea around ? Does some of you had any problem with Ajax and Firefox  
?

Just to be clear about the problem : the fields of the form are not  
posted (or at least their values are not in params[]) correctly with  
FireFox while it works fine with IE

Any help appreciated…

Thanks

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 27, 2007, 2:38pm UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/3 "2007-04-27T14:38:36Z")

</div>

This may or may not help, but the first approach I have whenever  
debugging different results among different browsers, is validate the  
html [http://validator.w3.org/](http://validator.w3.org/) . Generally invalid code will have  
inconsistencies among browsers, especially where javascript is  
concerned.

I hope that helps.

-Zach

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 27, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/4 "2007-04-27T14:42:31Z")

</div>

> Just to be clear about the problem : the fields of the form are not  
> posted (or at least their values are not in params[]) correctly with  
> FireFox while it works fine with IE  
> I never used “:html =\> {…}”, just :method =\> :post.  
> Have you looked at the generated HTML code? Have you tried debugging the  
> JavaScript code with Firebug  
> ([https://addons.mozilla.org/en-US/firefox/addon/1843](https://addons.mozilla.org/en-US/firefox/addon/1843))?

Happy coding

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 27, 2007, 5:19pm UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/5 "2007-04-27T17:19:31Z")

</div>

> Any idea around ? Does some of you had any problem with Ajax and Firefox  
> ?
> 
> Just to be clear about the problem : the fields of the form are not  
> posted (or at least their values are not in params[]) correctly with  
> FireFox while it works fine with IE

Is the request being submitted to Rails with Firefox? Or is nothing  
happening at all? And if the latter, are you using Rico? Try removing  
Rico and see if it solves the problem.

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 27, 2007, 9:50pm UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/6 "2007-04-27T21:50:15Z")

</div>

Philip H. wrote:

> Is the request being submitted to Rails with Firefox? Or is nothing  
> happening at all? And if the latter, are you using Rico? Try removing  
> Rico and see if it solves the problem.

Yes with Firefox the request is submitted with params containing only  
{“action”=\>“edit”, “id”=\>“5”, “controller”=\>“admin\_articles”}, and  
nothing about the fields of the form.

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 27, 2007, 2:58pm UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/7 "2007-04-27T14:58:11Z")

</div>

I read somewhere that you need to use :update=\> in order to let the  
form work; if the :update option is not needed use :update=\>{} as  
workaround  
Sandro, [www.railsonwave.com](http://www.railsonwave.com)

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 28, 2007, 1:04am UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/8 "2007-04-28T01:04:38Z")

</div>

Got it, Zach was right :  
[http://lists.rubyonrails.org/pipermail/rails-spinoffs/2006-April/003443.html](http://lists.rubyonrails.org/pipermail/rails-spinoffs/2006-April/003443.html)

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [April 28, 2007, 12:58am UTC](https://www.ruby-forum.com/t/remote-form-for-works-only-in-ie-not-firefox/93027/9 "2007-04-28T00:58:47Z")

</div>

I’ve found the reason, even if I have no solution : the HTML code  
generated by remote\_form\_for is

And when I check the result of Form.serialize(this) I can see the values  
when under IE but nothing under Firefox.

This happen even with \<%= javascript\_include\_tag :defaults %\>

I’ve checked the javascript Rails files under public/javascript and  
there are the latest - rake rails:update did his job

Still searching…
