Submit form using a link instead of a button


Which form should I use? I am currently using form_for.Is it the right
form to use? What I am supposed to do in the form is to save the various
fields and go to the next page when i click the link which i am going to
name next. I am now using <%= link_to_function 'Next',
"$('form_id').submit(0)" %> to create the link. I have tried to give the
form_for an id by doing this:

<% form_for :e0_1_prod_desc,:id => 'prod', :url => { :action =>
:save_prod_desc } do |n| %>

There is an error when I press submit.Can someone tell me the right way
to do this?

And i just saw from somewhere,

<%= link_to_function 'Submit', "$('form_id').submit(0)" %>

Why is submit(0)? What is the difference between submit(0) and submit()?


I think that should be

<%= link_to_function 'Submit', "$('prod').submit()" %>

and not

<%= link_to_function 'Submit', "$('form_id').submit(0)" %>

view source to make sure the <form> tag has id="prod" as you
intended. also you may want to call it product_form or something less
likely to conflict with something else.

:html => { :id => “here” }