# Retrieving values from combo box

**URL:** <https://www.ruby-forum.com/t/retrieving-values-from-combo-box/119337>\
**Category:** Ruby\
**Created:** [November 6, 2007, 5:05am UTC](https://www.ruby-forum.com/t/retrieving-values-from-combo-box/119337 "2007-11-06T05:05:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jojobert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@jojobert](https://www.ruby-forum.com/u/jojobert)\
**Post date:** [November 6, 2007, 5:05am UTC](https://www.ruby-forum.com/t/retrieving-values-from-combo-box/119337/1 "2007-11-06T05:05:54Z")

</div>

Jul/10:

 \<%= select\_tag "jul10", "YNR" %\>

At the moment, my html form displays this combo box the way i want it,  
but it does not record down what the user has selected and save it to  
the database

help please,

thanks!

---

<div class="post-metadata">

**Author:** ![jojobert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@jojobert](https://www.ruby-forum.com/u/jojobert)\
**Post date:** [November 6, 2007, 6:17am UTC](https://www.ruby-forum.com/t/retrieving-values-from-combo-box/119337/2 "2007-11-06T06:17:35Z")

</div>

Jojo M. wrote:

> Jul/10:
> 
> \<%= select\_tag "jul10", "YNR" %\>
> 
> At the moment, my html form displays this combo box the way i want it,  
> but it does not record down what the user has selected and save it to  
> the database

Write your javascript to respond to the onchange event and then retrieve  
the selected value. Then have your javascript send out an  
XMLHttpRequest to the server and include the choice in the url.

Good luck!

---

<div class="post-metadata">

**Author:** ![jojobert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@jojobert](https://www.ruby-forum.com/u/jojobert)\
**Post date:** [November 6, 2007, 6:22am UTC](https://www.ruby-forum.com/t/retrieving-values-from-combo-box/119337/3 "2007-11-06T06:22:12Z")

</div>

Hi,

On Tue, 2007-11-06 at 13:06 +0900, Jojo M. wrote:

> thanks!  
> For your Ruby on Rails-related questions, please check out the  
> rubyonrails-talk mailing list:

[http://groups.google.com/group/rubyonrails-talk](http://groups.google.com/group/rubyonrails-talk)

Meanwhile, you may receive a reply here, but this mailing list tends to  
be for Ruby-specific questions.

Cheers,  
Arlen
