# How to make multiple forms work

**URL:** <https://www.ruby-forum.com/t/how-to-make-multiple-forms-work/123147>\
**Category:** Rails\
**Created:** [December 14, 2007, 12:15pm UTC](https://www.ruby-forum.com/t/how-to-make-multiple-forms-work/123147 "2007-12-14T12:15:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 14, 2007, 12:15pm UTC](https://www.ruby-forum.com/t/how-to-make-multiple-forms-work/123147/1 "2007-12-14T12:15:08Z")

</div>

If I have a page with multiple forms that should correspond with 1  
element each, how can I do this? For example, if I was listing  
auctions and each one had a bid form (all on the same page), how can I  
make it so that when a user decides to bid on an auction it knows  
which form was entered?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 14, 2007, 12:19pm UTC](https://www.ruby-forum.com/t/how-to-make-multiple-forms-work/123147/2 "2007-12-14T12:19:13Z")

</div>

On Dec 14, 2007, at 3:14 AM, Mike C wrote:

> If I have a page with multiple forms that should correspond with 1  
> element each, how can I do this? For example, if I was listing  
> auctions and each one had a bid form (all on the same page), how can I  
> make it so that when a user decides to bid on an auction it knows  
> which form was entered?

A typical way to do that is to include a hidden input in each form  
which uniquely identifies that form/record using the record ID (of  
the item being bid on in your case).

–  
def gw  
acts\_as\_n00b  
writes\_at(www.railsdev.ws)  
end

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 14, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/how-to-make-multiple-forms-work/123147/3 "2007-12-14T21:39:00Z")

</div>

Alright, thanks! 🙂
