I can get the forms to be displayed, but i want to have only one "create" button. i''ve tried everything i can think of... -- Posted via http://www.ruby-forum.com/.
On 3/9/06, jon <jon.druse@gmail.com> wrote:> > I can get the forms to be displayed, but i want to have only one "create" > button. i''ve tried everything i can think of... >*If* I understand you, you want to have something like... [form1] [field1] [field2] [end_form1] [form2] [field3] [submit] [end_form2] ...and have the submit button submit both form1 and form2? That''s not something regulation HTML is capable of*. Is there a reason you can''t you just combine the forms? * You /could/, *technically*, do this in JavaScript with onsubmit(), but it''s error-prone and - at best - only works with JavaScript-enabled browsers. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060309/e95e2ab4/attachment.html
How do you have 2 forms on the same page with 2 diiferent submit tags? -- Posted via http://www.ruby-forum.com/.
John Butler wrote:> How do you have 2 forms on the same page with 2 diiferent submit tags?Can you post the rhtml you''re currently trying ? Alan -- Posted via http://www.ruby-forum.com/.
Well they cross paths when i render a partial but when they are currently on the same page they have the following code: <b>Leave a Reply</b> <%= form_tag :action => "comment", :id => @post %> <%= render :partial => ''commentform'' %> <p id=commentindent><%= submit_tag "Comment!" %></p> and <%= form_tag :action => ''search'' %> <p align =center><%= text_field_tag ''search'' , params[:search], "size" =>"20" %> <%= submit_tag ''Search'' %></p> <%= end_form_tag %> The 1st form Leave a reply gets called regardless of which submit button i click. -- Posted via http://www.ruby-forum.com/.
John Butler wrote:> Well they cross paths when i render a partial but when they are > currently on the same page they have the following code: > > <b>Leave a Reply</b> > <%= form_tag :action => "comment", :id => @post %> > <%= render :partial => ''commentform'' %> > <p id=commentindent><%= submit_tag "Comment!" %></p> > > and > > <%= form_tag :action => ''search'' %> > <p align =center><%= text_field_tag ''search'' , params[:search], "size" > =>"20" %> > <%= submit_tag ''Search'' %></p> > <%= end_form_tag %> > > The 1st form Leave a reply gets called regardless of which submit button > i click.There''s no end_form_tag after the first form ? Alan -- Posted via http://www.ruby-forum.com/.
Rimantas Liubertas
2006-Apr-05 15:40 UTC
[Rails] Re: how to make two forms on the same page???
<...>> <b>Leave a Reply</b> > <%= form_tag :action => "comment", :id => @post %> > <%= render :partial => ''commentform'' %> > <p id=commentindent><%= submit_tag "Comment!" %></p> > > and > > <%= form_tag :action => ''search'' %> > <p align =center><%= text_field_tag ''search'' , params[:search], "size" > =>"20" %> > <%= submit_tag ''Search'' %></p> > <%= end_form_tag %> > > The 1st form Leave a reply gets called regardless of which submit button > i click.Where''s your end_form_tag for the first form? Regards, Rimantas -- http://rimantas.com/