# Form\_for name

**URL:** <https://www.ruby-forum.com/t/form-for-name/135900>\
**Category:** Rails\
**Created:** [April 26, 2008, 12:27am UTC](https://www.ruby-forum.com/t/form-for-name/135900 "2008-04-26T00:27:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [April 26, 2008, 12:27am UTC](https://www.ruby-forum.com/t/form-for-name/135900/1 "2008-04-26T00:27:21Z")

</div>

Hello,  
I have a form in which I am using some javascript to disable the submit  
button after it is clicked. However, it ceases to submit the form. Thus,  
I need to use a javascript line that submits it. No problem there, but  
it won’t work because the form doesn’t have a ‘name’ tag. Using form\_for  
in my rhtml page in this manner:

\<% form\_for :push\_ex, :url =\> { :controller =\> ‘push’, :action =\>  
‘index’, :type =\> ‘push\_ex’} do %\>

results in this html:

I need the Ruby to render the HTML as:

I tried adding :name =\> “push\_ex” in the form\_for tag, but it doesn’t do  
anything. What can I do to add the name to the form?

Thanks!!!

- Jeff M.

---

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [April 26, 2008, 12:36am UTC](https://www.ruby-forum.com/t/form-for-name/135900/2 "2008-04-26T00:36:15Z")

</div>

On 25 Apr 2008, at 23:27, Jeff M. wrote:

> \<% form\_for :push\_ex, :url =\> { :controller =\> ‘push’, :action =\>  
> ‘index’, :type =\> ‘push\_ex’} do %\>

\<% form\_for :push\_ex, :url =\> { :controller =\> ‘push’, :action =\>  
‘index’, :type =\> ‘push\_ex’}, :html =\> {:name =\> ‘push\_ex’} do %\>

should do the trick

Fred

---

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [April 26, 2008, 12:43am UTC](https://www.ruby-forum.com/t/form-for-name/135900/3 "2008-04-26T00:43:17Z")

</div>

thanks, man! you’re a wealth of information! I think you’ve answered my  
last 3 or 4 questions!
