# Cascaded Forms

**URL:** <https://www.ruby-forum.com/t/cascaded-forms/94998>\
**Category:** Rails\
**Created:** [May 19, 2006, 12:32am UTC](https://www.ruby-forum.com/t/cascaded-forms/94998 "2006-05-19T00:32:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franz\_Bettag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@Franz\_Bettag](https://www.ruby-forum.com/u/Franz_Bettag)\
**Post date:** [May 19, 2006, 12:32am UTC](https://www.ruby-forum.com/t/cascaded-forms/94998/1 "2006-05-19T00:32:16Z")

</div>

Hi guys, it’s me again 😉

is it possible to put forms into forms? My problem is, i have a form  
which gathers informations about an SSL Certificate order. There is a  
field which holds the SSL CSR file. Now i wanted to put in a subform  
which has an form\_remote\_tag and decodes that CSR file and returns if  
everything was okay or not.

Now if i put in a submit\_tag it submits my form which holds the ssl cert  
order instead of the subform which should only check for the correctness  
of the CSR 🙂

I mean in PHP i’d assign the form a ‘name’ or ‘id’ and then do  
javascript: document.getElementByID(‘subform’).submit() but that won’t  
work in rails since i can’t assign a name or id to a form 😕

Any ideas for this? Thanks in advance

---

<div class="post-metadata">

**Author:** ![Franz\_Bettag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@Franz\_Bettag](https://www.ruby-forum.com/u/Franz_Bettag)\
**Post date:** [May 19, 2006, 12:45am UTC](https://www.ruby-forum.com/t/cascaded-forms/94998/2 "2006-05-19T00:45:26Z")

</div>

There’s no reason to nest the forms. Make them seperate and you should  
have no problems.

If that won’t work, don’t use form\_remote\_tag. You’d have to make your  
own semi-form using Prototype that “submits” the file field when you  
click a button. Overall, it’d wouldn’t be pretty.

---

<div class="post-metadata">

**Author:** ![Franz\_Bettag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@Franz\_Bettag](https://www.ruby-forum.com/u/Franz_Bettag)\
**Post date:** [May 19, 2006, 3:02am UTC](https://www.ruby-forum.com/t/cascaded-forms/94998/3 "2006-05-19T03:02:05Z")

</div>

Franz Bettag wrote:

> is it possible to put forms into forms? My problem is, i have a form  
> which gathers informations about an SSL Certificate order. There is a  
> field which holds the SSL CSR file. Now i wanted to put in a subform  
> which has an form\_remote\_tag and decodes that CSR file and returns if  
> everything was okay or not.
> 
> Now if i put in a submit\_tag it submits my form which holds the ssl cert  
> order instead of the subform which should only check for the correctness  
> of the CSR 🙂

Instead use submit\_to\_remote and its :submit option, because this does  
not create an HTML form.

–  
We develop, watch us RoR, in numbers too big to ignore.

---

<div class="post-metadata">

**Author:** ![Franz\_Bettag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@Franz\_Bettag](https://www.ruby-forum.com/u/Franz_Bettag)\
**Post date:** [May 19, 2006, 9:40am UTC](https://www.ruby-forum.com/t/cascaded-forms/94998/4 "2006-05-19T09:40:07Z")

</div>

Mark Reginald J. wrote:

> Franz Bettag wrote:
> 
> > is it possible to put forms into forms? My problem is, i have a form  
> > which gathers informations about an SSL Certificate order. There is a  
> > field which holds the SSL CSR file. Now i wanted to put in a subform  
> > which has an form\_remote\_tag and decodes that CSR file and returns if  
> > everything was okay or not.
> > 
> > Now if i put in a submit\_tag it submits my form which holds the ssl cert  
> > order instead of the subform which should only check for the correctness  
> > of the CSR 🙂
> 
> Instead use submit\_to\_remote and its :submit option, because this does  
> not create an HTML form.
> 
> –  
> We develop, watch us RoR, in numbers too big to ignore.

Well this is quite the solution i appreciate 🙂  
Mark, so it is not possible to do this like an subform (with multiple  
fields)? it’s just possible with single fields? 🙂

Thanks to all.

---

<div class="post-metadata">

**Author:** ![Franz\_Bettag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@Franz\_Bettag](https://www.ruby-forum.com/u/Franz_Bettag)\
**Post date:** [May 19, 2006, 6:23am UTC](https://www.ruby-forum.com/t/cascaded-forms/94998/5 "2006-05-19T06:23:48Z")

</div>

Html forms may not be nested.

If you’re using form\_tag, it’s second arg is a hash of attributes to add  
to the form tag.  
So, you can give it a name or an id attribute just fine (though the name  
attribute is  
deprecated in xhtml).

b
