Two start_form_tag and 2 submit button in one rhtml file

Hi

I have a file edit.rhtml

<%= start_form_tag ({ :action => ‘update’, :id => @ci, :method =>
‘post’}, :class => ‘itilform’, :enctype => ‘multipart/form-data’,
:onSubmit => ‘return validate_form();’)%>

<% if @ci.citype== '1' %> <%= render :partial=>'cipart/edit_hardware_ci' %> <% end %>

Save

<%= end_form_tag %>

In partial file _edit_hardware_ci.rhtml there is another
start_form_tag and submit tab.The File is as folliows

<%= start_form_tag ({:controller => ‘ci’, :action =>
‘edit_ci_functional_spec’, :ci => @ci, :method => ‘post’}, :class =>
‘itilform’)%>

<%= text_area "ci_content", "functional_spec", "cols" => 120, "rows" => 5 %>
<%#= submit_tag('Save') %> Save
<%= end_form_tag %>

BUT SUBMIT BUTTON IN THE PARTIAL FILE CALLS THE ACTION IN
EDIT.RHTML…HOW CAN I CALL THE ACTION SPECIFIED IN THE STRAT FORM TAG
OF PARTIAL FILE _EDIT_HARDWARE_CI.RHTML

Sijo

This is not really a Rails issue, but a HTML form issue. In short,
you’re not allowed to nest forms. You’ve effectively done that by
wrapping a form around the table that includes the partial (which also
wraps a form around a table).

IMO, the best thing to do is rethink the UI structure to avoid the
nesting. If you cannot achieve that then you could use a
button_to_function and supply it a remote_function that uses
the :submit param to send your inner (partial) form.