Forum: Ruby on Rails Cascaded Forms

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Franz Bettag (Guest)
on 2006-05-19 02:32
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
Bryan D. (Guest)
on 2006-05-19 02:45
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.
Mark Reginald J. (Guest)
on 2006-05-19 05:02
(Received via mailing list)
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.
Ben M. (Guest)
on 2006-05-19 08:23
(Received via mailing list)
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
Franz Bettag (Guest)
on 2006-05-19 11:40
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.
This topic is locked and can not be replied to.