Hello, I need to put an AJAX, form such that it is inside a table, and spans across few rows. But, what I am noticing is that, while submitting the form, the data in the fields is not submitted. If I move the form outside the table or inside a cell, things work OK, but not when the form is inside the table and spans few rows. This problem is only with AJAX forms, regular forms work perfect. I was wondering if this is something to do with prototype, or am I doing something completely wrong? Below, is a stripped down version of the code, which I have been trying. While calling the action the parameter, member_id is not passed. <table> <%= form_remote_tag(:url => {:controller => ''relationships'', :action => ''move''}) %> <%= hidden_field_tag ''member_id'',10 %> <tr> <td ></td> </tr> <%= submit_tag "Save", :class => "button" %> <%= end_form_tag %> </table> Thanks for your help. -- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read my blog at: http://cuttingtheredtape.blogspot.com/ ,---- | "All animals are equal, but some animals are more equal than others." | -- Orwell, Animal Farm, 1945 `----
Hi Surendra, I was recently trying to do the same thing and basically I discovered that it''s not really possible to do this reliably because it doesn''t conform to web standards and doesn''t seem to be supported by browsers. I ended up fitting my form in a single td cell, although I made the cell span several columns. I think it''s worth looking at the code used by the ajax scaffold generator to get an idea of a possible solution. Good luck, Sean On 15-Jun-06, at 1:39 PM, Surendra Singhi wrote:> Hello, > I need to put an AJAX, form such that it is inside a table, and > spans across > few rows. > But, what I am noticing is that, while submitting the form, the > data in the > fields is not submitted. > > If I move the form outside the table or inside a cell, things work > OK, but not > when the form is inside the table and spans few rows. This problem > is only > with AJAX forms, regular forms work perfect. I was wondering if > this is > something to do with prototype, or am I doing something completely > wrong? > > Below, is a stripped down version of the code, which I have been > trying. While > calling the action the parameter, member_id is not passed. > > <table> > <%= form_remote_tag(:url => {:controller => > ''relationships'', :action => ''move''}) %> > <%= hidden_field_tag ''member_id'',10 %> > <tr> <td ></td> > </tr> > <%= submit_tag "Save", :class => "button" %> > <%= end_form_tag %> > </table> > > Thanks for your help. > -- > Surendra Singhi > http://ssinghi.kreeti.com, http://www.kreeti.com > Read my blog at: http://cuttingtheredtape.blogspot.com/ > ,---- > | "All animals are equal, but some animals are more equal than > others." > | -- Orwell, Animal Farm, 1945 > `---- > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
fwiw, having a form tag as a child to a table tag is not valid markup in xhtml (and bad form in any other, in my opinion) . Is there a particular reason why you put form tags within a table like that and not around the table or within a table cell? Chris On 6/15/06, Sean O''Hara <sohara@sohara.com> wrote:> > Hi Surendra, > > I was recently trying to do the same thing and basically I discovered > that it''s not really possible to do this reliably because it doesn''t > conform to web standards and doesn''t seem to be supported by > browsers. I ended up fitting my form in a single td cell, although I > made the cell span several columns. I think it''s worth looking at the > code used by the ajax scaffold generator to get an idea of a possible > solution. > > Good luck, > Sean > > On 15-Jun-06, at 1:39 PM, Surendra Singhi wrote: > > > Hello, > > I need to put an AJAX, form such that it is inside a table, and > > spans across > > few rows. > > But, what I am noticing is that, while submitting the form, the > > data in the > > fields is not submitted. > > > > If I move the form outside the table or inside a cell, things work > > OK, but not > > when the form is inside the table and spans few rows. This problem > > is only > > with AJAX forms, regular forms work perfect. I was wondering if > > this is > > something to do with prototype, or am I doing something completely > > wrong? > > > > Below, is a stripped down version of the code, which I have been > > trying. While > > calling the action the parameter, member_id is not passed. > > > > <table> > > <%= form_remote_tag(:url => {:controller => > > ''relationships'', :action => ''move''}) %> > > <%= hidden_field_tag ''member_id'',10 %> > > <tr> <td ></td> > > </tr> > > <%= submit_tag "Save", :class => "button" %> > > <%= end_form_tag %> > > </table> > > > > Thanks for your help. > > -- > > Surendra Singhi > > http://ssinghi.kreeti.com, http://www.kreeti.com > > Read my blog at: http://cuttingtheredtape.blogspot.com/ > > ,---- > > | "All animals are equal, but some animals are more equal than > > others." > > | -- Orwell, Animal Farm, 1945 > > `---- > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060616/50ec7743/attachment-0001.html