Cascaded Forms

Hi guys, it’s me again :wink:

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 :slight_smile:

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 :confused:

Any ideas for this? Thanks in advance

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.

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 :slight_smile:

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.

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 :slight_smile:

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 :slight_smile:
Mark, so it is not possible to do this like an subform (with multiple
fields)? it’s just possible with single fields? :slight_smile:

Thanks to all.

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