# Collection\_select :onchange event

**URL:** <https://www.ruby-forum.com/t/collection-select-onchange-event/121170>\
**Category:** Rails\
**Created:** [November 24, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/collection-select-onchange-event/121170 "2007-11-24T22:01:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [November 24, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/collection-select-onchange-event/121170/1 "2007-11-24T22:01:10Z")

</div>

Hello,

it´s simple,

i have an collection\_select that work well and im trying to fire some  
action in the controller passing the value that the user has selected.  
obs: without ajax request…

---

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [November 26, 2007, 8:11am UTC](https://www.ruby-forum.com/t/collection-select-onchange-event/121170/2 "2007-11-26T08:11:26Z")

</div>

Then create a script like this…

function JumpToIt(list){  
var selection = list.options[list.selectedIndex].value;  
location.href = “/controller/action/” + selection; // here  
selection acts as params  
}

where you have to call the function in onChange  
… :onChange =\> ‘Jumpto(this);’

Regards.
