# Get a Selected value

**URL:** <https://www.ruby-forum.com/t/get-a-selected-value/180742>\
**Category:** Rails\
**Created:** [December 28, 2009, 11:19am UTC](https://www.ruby-forum.com/t/get-a-selected-value/180742 "2009-12-28T11:19:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![isabel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/977dab/32.png) [@isabel](https://www.ruby-forum.com/u/isabel)\
**Post date:** [December 28, 2009, 11:19am UTC](https://www.ruby-forum.com/t/get-a-selected-value/180742/1 "2009-12-28T11:19:09Z")

</div>

Hi,

I wonder how is possible to get a value that has been selected from the  
elemenet “select” within a form.

This is my case:

```
<td><%= select :worker_contract, :contract_type_id,

```

contract\_types\_for\_select.map{|c| [c.name, c.id]}, {:class =\>  
‘w150’, :selected =\> nil, :disabled =\> !admin?} %\>

I would like to filter the value that the user selects on this dropdown  
list.

Could you help me?

Best Regards

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
