# How to pass a form DOM ID to submit\_to\_remote, just like with observe\_form?

**URL:** <https://www.ruby-forum.com/t/how-to-pass-a-form-dom-id-to-submit-to-remote-just-like-with-observe-form/189546>\
**Category:** Rails\
**Created:** [June 2, 2010, 9:36pm UTC](https://www.ruby-forum.com/t/how-to-pass-a-form-dom-id-to-submit-to-remote-just-like-with-observe-form/189546 "2010-06-02T21:36:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@Lille](https://www.ruby-forum.com/u/Lille)\
**Post date:** [June 2, 2010, 9:36pm UTC](https://www.ruby-forum.com/t/how-to-pass-a-form-dom-id-to-submit-to-remote-just-like-with-observe-form/189546/1 "2010-06-02T21:36:11Z")

</div>

Hi,

I’d like to use submit\_to\_remote just like observe\_form: I want to  
supply a DOM ID to submit\_to\_remote.

I’ve searched around, but I do not see any way to do this. It seems  
odd that I shouldn’t be able to use a form DOM ID in something like  
submit\_to\_remote. Any thoughts?

(I’m doing this because I want to allow users to choose when to make  
an ajax call from submit\_to\_remote element that is NOT part of the  
form I want to submit.)

Thanks,

Lille

---

<div class="post-metadata">

**Author:** ![Lille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@Lille](https://www.ruby-forum.com/u/Lille)\
**Post date:** [June 2, 2010, 9:54pm UTC](https://www.ruby-forum.com/t/how-to-pass-a-form-dom-id-to-submit-to-remote-just-like-with-observe-form/189546/2 "2010-06-02T21:54:20Z")

</div>

Got it. This can be accomplished by the :submit option described in  
the following doc:

[http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M002174](http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M002174)

Lille
