Form_remote_tag not posting data

I’m trying to use the form_remote_tag for the first time…

Here is my code:

<%= form_remote_tag(:url => { :action => ‘add’ } ) %>

<%= text_field_tag ‘name’ %>
<%= text_field_tag ‘email’ %>
<%= submit_tag ‘icon_additem.gif’ %>
<%= end_form_tag %>

For whatever reason this is not submitting any of my params… The log
shows no params being sent.

Env is OSX 10.4 + Lighttpd + Safari/Firefox/Camino.

Any clue what is wrong?? I’m trying to do a demo in 30min without any
luck.

Thanks.

Josh

Josh K. wrote:

<%= form_remote_tag(:url => { :action => ‘add’ } ) %>

<%= text_field_tag 'name' %> <%= text_field_tag 'email' %> <%= submit_tag 'icon_additem.gif' %> <%= end_form_tag %>

For whatever reason this is not submitting any of my params… The log
shows no params being sent.

Make sure your form_remote_tag/end_form_tag pair is placed
outside any

tags.


We develop, watch us RoR, in numbers too big to ignore.

On 5/7/06, Mark Reginald J. [email protected] wrote:

Make sure your form_remote_tag/end_form_tag pair is placed
outside any

tags.

Mark, thanks for your reply. This makes no sense why these tags would
have
to be outside the table tag. Also, I was unable to insert a row into
the
table using RJS. Is this just a fact of life with tables? I know that
I
should be using div/css but are these problems documented anywhere? I’m
assuming its not just a Rails thing and I’d like to know more about what
causes this problem.

Thanks.

Josh K. wrote:

Mark, thanks for your reply. This makes no sense why these tags would
have to be outside the table tag. Also, I was unable to insert a row
into the table using RJS. Is this just a fact of life with tables? I
know that I should be using div/css but are these problems documented
anywhere? I’m assuming its not just a Rails thing and I’d like to know
more about what causes this problem.

Forms inside tables is a HTML issue. You can’t place a form tag at a
position at which only a thead, tbody, th, tr, or td tag is allowed. You
can however place a form inside a td, possibly followed by a nested
table.

Your inability to insert a row using RJS is probably an Internet
Explorer
issue. I’ve read that people have had success when using the Taconite
extension for Prototype: http://taconite.sourceforge.net/


We develop, watch us RoR, in numbers too big to ignore.

Mark Reginald J. wrote:

Forms inside tables is a HTML issue. You can’t place a form tag at a
position at which only a thead, tbody, th, tr, or td tag is allowed. You
can however place a form inside a td, possibly followed by a nested
table.

Your inability to insert a row using RJS is probably an Internet
Explorer
issue. I’ve read that people have had success when using the Taconite
extension for Prototype: http://taconite.sourceforge.net/


We develop, watch us RoR, in numbers too big to ignore.

Thanks, I too was having this problem. But I too am confused about the
cause of the problem. My code was very similar to Josh’s, but I then
went back and replaced my form_remote_tag with an equivalent form_tag
(removing the AJAX), and the params were posted properly. So it doesn’t
seem to be solely a HTML issue with forms. It seems like it is an issue
with AJAX, HTML and forms.

Any thoughts on why it works with a regular form_tag?

-Ryan

Ryan,

I had a problem that seems similar to yours. After hacking at it for
way too much time, I figured it out. If it’s at all helpful, here’s
the posting:

http://www.ruby-forum.com/topic/79293#new

  • David