# Calling a remote method on choosing an item from Select

**URL:** <https://www.ruby-forum.com/t/calling-a-remote-method-on-choosing-an-item-from-select/158131>\
**Category:** Rails\
**Created:** [January 19, 2009, 4:23pm UTC](https://www.ruby-forum.com/t/calling-a-remote-method-on-choosing-an-item-from-select/158131 "2009-01-19T16:23:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [January 19, 2009, 4:23pm UTC](https://www.ruby-forum.com/t/calling-a-remote-method-on-choosing-an-item-from-select/158131/1 "2009-01-19T16:23:48Z")

</div>

Hi,

Is there a way where in I can trigger remote action when an user choose  
one of the options in the dropdown of “select” method?

Mebbe something like on\_change but instead of triggering JS action,  
remote action is what i am looking at.

Please suggest

Regards,  
Sandeep

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [January 19, 2009, 5:47pm UTC](https://www.ruby-forum.com/t/calling-a-remote-method-on-choosing-an-item-from-select/158131/2 "2009-01-19T17:47:17Z")

</div>

On 19 Jan 2009, at 15:23, Sandeep G. wrote:

> Please suggest

onchange is what you want. the javascript in there should make an ajax  
request.

Fred

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [January 19, 2009, 8:29pm UTC](https://www.ruby-forum.com/t/calling-a-remote-method-on-choosing-an-item-from-select/158131/3 "2009-01-19T20:29:51Z")

</div>

Thanks Fred.  
I used something like this:  
{:onchange =\> ‘window.location=this.value;’}  
the value of the select option can be made text link. So it worked like  
a charm for me to load a new page on selecting an option.
