# Can i use "form\_remote\_tag" inside the "form\_tag"?

**URL:** <https://www.ruby-forum.com/t/can-i-use-form-remote-tag-inside-the-form-tag/175674>\
**Category:** Rails\
**Created:** [September 17, 2009, 2:21pm UTC](https://www.ruby-forum.com/t/can-i-use-form-remote-tag-inside-the-form-tag/175674 "2009-09-17T14:21:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [September 17, 2009, 2:21pm UTC](https://www.ruby-forum.com/t/can-i-use-form-remote-tag-inside-the-form-tag/175674/1 "2009-09-17T14:21:32Z")

</div>

Hi all,

How can i use form\_remote\_tag inside the form\_tag helper .

My application has following view subscribe.html.haml

- form\_tag :action =\> :subscribe do

Can I use form\_remote\_tag inside the form\_tag?

When user hit ‘Apply Discount’ button i will perform following steps

get the value of radio button “tariff\_plan\_id” and from this value  
get the value from “discount\_code” textbox.

perform some operations on these value and  
result is show in “result\_discount\_code” div.

There are two radio buttons. so user can select one of them see what  
discount he will get.

Is this a right way to doing this?

Thanks ,  
Vikas

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [September 17, 2009, 2:28pm UTC](https://www.ruby-forum.com/t/can-i-use-form-remote-tag-inside-the-form-tag/175674/2 "2009-09-17T14:28:10Z")

</div>

On 17 Sep 2009, at 13:21, Vikas G. wrote:

> Hi all,
> 
> How can i use form\_remote\_tag inside the form\_tag helper .

forms cannot be nested. I imagine you could skip the second form and  
wire up the ajax request straight to a button.

Fred

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [September 18, 2009, 5:58am UTC](https://www.ruby-forum.com/t/can-i-use-form-remote-tag-inside-the-form-tag/175674/3 "2009-09-18T05:58:58Z")

</div>

Hi  
Forms can not be nested Browsers handle form focus, index fields(tab  
behavior) return behavior and those are reasonable concerns not to do  
that.

If you want to be able to achieve what you mentioned there, using  
rails prototype helpers obeserve\_field is a suggestion you can apply  
that to any other JS library you might be using.

Thanks  
Abhijat

On Sep 17, 10:21 pm, Vikas G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
