# Alternative to nested form tags

**URL:** <https://www.ruby-forum.com/t/alternative-to-nested-form-tags/70519>\
**Category:** Rails\
**Created:** [December 17, 2005, 3:08am UTC](https://www.ruby-forum.com/t/alternative-to-nested-form-tags/70519 "2005-12-17T03:08:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jennyw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7feea3/32.png) [@jennyw](https://www.ruby-forum.com/u/jennyw)\
**Post date:** [December 17, 2005, 3:08am UTC](https://www.ruby-forum.com/t/alternative-to-nested-form-tags/70519/1 "2005-12-17T03:08:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jennyw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7feea3/32.png) [@jennyw](https://www.ruby-forum.com/u/jennyw)\
**Post date:** [December 17, 2005, 3:47am UTC](https://www.ruby-forum.com/t/alternative-to-nested-form-tags/70519/2 "2005-12-17T03:47:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jennyw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7feea3/32.png) [@jennyw](https://www.ruby-forum.com/u/jennyw)\
**Post date:** [December 17, 2005, 4:05am UTC](https://www.ruby-forum.com/t/alternative-to-nested-form-tags/70519/3 "2005-12-17T04:05:18Z")

</div>

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.
