# Retrieving values from combo box

**URL:** <https://rubytalk.org/t/retrieving-values-from-combo-box/41941>\
**Category:** ruby-talk\
**Created:** [6 November 2007 04:06 UTC](https://rubytalk.org/t/retrieving-values-from-combo-box/41941 "2007-11-06T04:06:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jojo\_Mojo](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@Jojo\_Mojo](https://rubytalk.org/u/Jojo_Mojo)\
**Post date:** [6 November 2007 04:06 UTC](https://rubytalk.org/t/retrieving-values-from-combo-box/41941/1 "2007-11-06T04:06:05Z")

</div>

\<td\>\<p align="right"\>Jul/10:\</td\>  
&nbsp;&nbsp;\<td\>\<%= select\_tag "jul10",  
"\<option\>Y\</option\>\<option\>N\</option\>\<option\>R\</option\>" %\>\</td\>

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!

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![7stud](https://avatars.discourse-cdn.com/v4/letter/7/57b2e6/32.png) [@7stud](https://rubytalk.org/u/7stud)\
**Post date:** [6 November 2007 05:18 UTC](https://rubytalk.org/t/retrieving-values-from-combo-box/41941/2 "2007-11-06T05:18:04Z")

</div>

Jojo Mojo wrote:

> \<td\>\<p align="right"\>Jul/10:\</td\>  
> &nbsp;&nbsp;\<td\>\<%= select\_tag "jul10",  
> "\<option\>Y\</option\>\<option\>N\</option\>\<option\>R\</option\>" %\>\</td\>
> 
> 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!

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Arlen\_Christian\_Mar1](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Arlen\_Christian\_Mar1](https://rubytalk.org/u/Arlen_Christian_Mar1)\
**Post date:** [6 November 2007 05:20 UTC](https://rubytalk.org/t/retrieving-values-from-combo-box/41941/3 "2007-11-06T05:20:45Z")

</div>

Hi,

> \<td\>\<p align="right"\>Jul/10:\</td\>  
> &nbsp;&nbsp;\<td\>\<%= select\_tag "jul10",  
> "\<option\>Y\</option\>\<option\>N\</option\>\<option\>R\</option\>" %\>\</td\>
> 
> 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!

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

> **···**
>
> On Tue, 2007-11-06 at 13:06 +0900, Jojo Mojo wrote:
