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.
57e939ff00f9df2670a09f417c08da5e?d=identicon&s=25 Josh Knowles (Guest)
on 2006-05-06 22: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
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2006-05-06 23:26
(Received via mailing list)
Josh Knowles 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.
57e939ff00f9df2670a09f417c08da5e?d=identicon&s=25 Josh Knowles (Guest)
on 2006-05-07 05:08
(Received via mailing list)
On 5/7/06, Mark Reginald James <mrj@bigpond.net.au> 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.
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2006-05-07 06:36
(Received via mailing list)
Josh Knowles 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.
Ef1182698fe5f1ddbc9c6011e2841c06?d=identicon&s=25 Ryan Sandridge (dissolved)
on 2006-08-28 17:43
Mark Reginald James 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
F93305e2665776f68ecfdf32504f72e0?d=identicon&s=25 David Bean (farmallfan)
on 2006-08-30 04: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.