Forum: Ruby on Rails form_remote_tag not posting data

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Josh K. (Guest)
on 2006-05-07 00:38
(Received via mailing list)
I'm trying to use the form_remote_tag for the first time..

Here is my code:

<%= form_remote_tag(:url => { :action => 'add' } ) %>
    <td size='100'><%= text_field_tag 'name' %></td>
    <td size='200'><%= text_field_tag 'email' %></td>
    <td id='submit'><%= submit_tag 'icon_additem.gif' %></td>
<%= 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
Mark Reginald J. (Guest)
on 2006-05-07 01:26
(Received via mailing list)
Josh K. wrote:

> <%= form_remote_tag(:url => { :action => 'add' } ) %>
>    <td size='100'><%= text_field_tag 'name' %></td>
>    <td size='200'><%= text_field_tag 'email' %></td>
>    <td id='submit'><%= submit_tag 'icon_additem.gif' %></td>
> <%= 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 <table> tags.


--
We develop, watch us RoR, in numbers too big to ignore.
Josh K. (Guest)
on 2006-05-07 07:08
(Received via mailing list)
On 5/7/06, Mark Reginald J. <removed_email_address@domain.invalid> wrote:

>
> Make sure your form_remote_tag/end_form_tag pair is placed
> outside any <table> 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.
Mark Reginald J. (Guest)
on 2006-05-07 08:36
(Received via mailing list)
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.
Ryan S. (Guest)
on 2006-08-28 19:43
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
David B. (Guest)
on 2006-08-30 06:15
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
This topic is locked and can not be replied to.