# Having 2 forms/ Storing form data onto sessions?

**URL:** <https://www.ruby-forum.com/t/having-2-forms-storing-form-data-onto-sessions/117447>\
**Category:** Rails\
**Created:** [October 17, 2007, 12:25am UTC](https://www.ruby-forum.com/t/having-2-forms-storing-form-data-onto-sessions/117447 "2007-10-17T00:25:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rich](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@rich](https://www.ruby-forum.com/u/rich)\
**Post date:** [October 17, 2007, 12:25am UTC](https://www.ruby-forum.com/t/having-2-forms-storing-form-data-onto-sessions/117447/1 "2007-10-17T00:25:20Z")

</div>

I am trying to find a way to have two forms on the same page. However  
when I hit the submit button on one form the data that had been  
entered on the other form disappears. Is there a way to transfer the  
data on a form perhaps onto sessions? I tried having one form wrap  
onto another but it got messy and would not work.

An example is where there are two forms one to submit a message and  
one to upload files. Suppose I would start writing a message on the  
first form and then I upload a file using a second form. After  
uploading the file the message of the text area field would  
disappear.

Any ideas?

Thanks.

-Richard

---

<div class="post-metadata">

**Author:** ![rich](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@rich](https://www.ruby-forum.com/u/rich)\
**Post date:** [October 17, 2007, 1:08am UTC](https://www.ruby-forum.com/t/having-2-forms-storing-form-data-onto-sessions/117447/2 "2007-10-17T01:08:36Z")

</div>

1. nesting tags is invalid HTML and will never work

2. only thing i can think of to solve this is using AJAX to submit the  
form.
