Forum: Ruby on Rails Alternative to nested form tags

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.
114a64bf4e0cb600120f348b6447c258?d=identicon&s=25 Jennyw Jennyw (jennyw)
on 2005-12-17 03:08
(Received via mailing list)
You can't nest HTML forms, so I was wondering ...

I have an HTML form, and I have one element where I want to use Ajax
inside the form (e.g., a pop-up that contains a search box when there
are too many items for a selection list) ... how would I accomplish
that?  If I could use nested form tags, I could put a small, one-field
search form inside the larger form.

Thanks!

Jen
Fe9b2d0628c0943af374b2fe5b320a82?d=identicon&s=25 Eero Saynatkari (rue)
on 2005-12-17 03:47
jennyw jennyw wrote:
> You can't nest HTML forms, so I was wondering ...
>
> I have an HTML form, and I have one element where I want to use Ajax
> inside the form (e.g., a pop-up that contains a search box when there
> are too many items for a selection list) ... how would I accomplish
> that?  If I could use nested form tags, I could put a small, one-field
> search form inside the larger form.
>
> Thanks!

Unless you are actually processing form data, you
could use the link_to_remote method.

> Jen


E
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2005-12-17 04:05
(Received via mailing list)
jennyw wrote:
> You can't nest HTML forms, so I was wondering ...
>
> I have an HTML form, and I have one element where I want to use Ajax
> inside the form (e.g., a pop-up that contains a search box when there
> are too many items for a selection list) ... how would I accomplish
> that?  If I could use nested form tags, I could put a small, one-field
> search form inside the larger form.

submit_to_remote has a :submit option that allows you to send an
AJAX request without a form. It will post the values of named
entities located within a specified branch of the DOM.

--
We develop, watch us RoR, in numbers too big to ignore.
This topic is locked and can not be replied to.