# Re: Submit a form using a link

**URL:** <https://www.ruby-forum.com/t/re-submit-a-form-using-a-link/125560>\
**Category:** Rails\
**Created:** [January 10, 2008, 3:55am UTC](https://www.ruby-forum.com/t/re-submit-a-form-using-a-link/125560 "2008-01-10T03:55:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fries88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6bbea6/32.png) [@fries88](https://www.ruby-forum.com/u/fries88)\
**Post date:** [January 10, 2008, 3:55am UTC](https://www.ruby-forum.com/t/re-submit-a-form-using-a-link/125560/1 "2008-01-10T03:55:39Z")

</div>

Re: Submit a form using a link  
Posted by fries 88 (fries88) on 10.01.2008 03:42  
Jeremy Weiskotten wrote:

> Brian H. wrote:
> 
> > Why do you want to use a link? It’s really not such a good idea, as  
> > people  
> > are generally used to using a button.
> > 
> > If it’s an absolute requirement, the approach I have always taken is to  
> > apply CSS to the button to make it look like a link.
> > 
> > Other solutions involve making the link call a javascript function that  
> > submits the form. Yuk.
> 
> \<%= link\_to\_function ‘Submit’, “$(‘form\_id’).submit()” %\>
> 
> But yeah, yuk. Stick with a button unless there’s a good reason for a  
> link (design-wise).

Hmm…So which form should i use? I am supposed to save the various  
fields and go to the next page when i click the link which i am going to  
name next. 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| %\>

Is it the right way? 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()?

Thanks
