# Passing values selected with onchange remote\_function

**URL:** <https://www.ruby-forum.com/t/passing-values-selected-with-onchange-remote-function/136686>\
**Category:** Rails\
**Created:** [May 5, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/passing-values-selected-with-onchange-remote-function/136686 "2008-05-05T15:22:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OhMyRuby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/0ea827/32.png) [@OhMyRuby](https://www.ruby-forum.com/u/OhMyRuby)\
**Post date:** [May 5, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/passing-values-selected-with-onchange-remote-function/136686/1 "2008-05-05T15:22:39Z")

</div>

How do i pass the value selected from a drop down selection and then  
extract it in rjs

\<% select(“what”, “hello”, @selection, {}, {:onchange =\>  
remote\_function(:url =\> “test”, :my\_variable =\> “hello again”) } ) %\>

thanks.

---

<div class="post-metadata">

**Author:** ![OhMyRuby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/0ea827/32.png) [@OhMyRuby](https://www.ruby-forum.com/u/OhMyRuby)\
**Post date:** [May 5, 2008, 5:33pm UTC](https://www.ruby-forum.com/t/passing-values-selected-with-onchange-remote-function/136686/2 "2008-05-05T17:33:55Z")

</div>

Like this:

\<%= observe\_field :html\_id\_of\_select, :url =\> {:action =\> “test” },  
:with =\> ‘variable\_name’ %\>
