# How to invoke form\_remote\_tag from javascript?

**URL:** <https://www.ruby-forum.com/t/how-to-invoke-form-remote-tag-from-javascript/137675>\
**Category:** Rails\
**Created:** [May 15, 2008, 9:08am UTC](https://www.ruby-forum.com/t/how-to-invoke-form-remote-tag-from-javascript/137675 "2008-05-15T09:08:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f19dbf/32.png) [@gringo](https://www.ruby-forum.com/u/gringo)\
**Post date:** [May 15, 2008, 9:08am UTC](https://www.ruby-forum.com/t/how-to-invoke-form-remote-tag-from-javascript/137675/1 "2008-05-15T09:08:52Z")

</div>

Hello,

how can I move below functionality defined in rhtml to the javascript  
function?

\<% form\_remote\_tag :url =\> { :action =\> :small\_courses\_list } do %\>  
\<%= submit\_tag “click!” %\>  
\<% end %\>

I just want to invoke :small\_courses\_list action from the javascript  
function by AJAX.

Thanks  
gringo

---

<div class="post-metadata">

**Author:** ![gringo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f19dbf/32.png) [@gringo](https://www.ruby-forum.com/u/gringo)\
**Post date:** [May 15, 2008, 9:22am UTC](https://www.ruby-forum.com/t/how-to-invoke-form-remote-tag-from-javascript/137675/2 "2008-05-15T09:22:31Z")

</div>

On May 15, 1:11 am, gringo [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello,
> 
> how can I move below functionality defined in rhtml to the javascript  
> function?

The easiest way might be to inspect what html/js this produces

> \<% form\_remote\_tag :url =\> { :action =\> :small\_courses\_list } do %\>  
> \<%= submit\_tag “click!” %\>  
> \<% end %\>

Give it a go and you’ll see it’s just an Ajax.Request using  
Form.serialize to get the params.

Fred
