# Problem With Drop Down LIst

**URL:** <https://www.ruby-forum.com/t/problem-with-drop-down-list/125312>\
**Category:** Rails\
**Created:** [January 8, 2008, 4:57am UTC](https://www.ruby-forum.com/t/problem-with-drop-down-list/125312 "2008-01-08T04:57:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ed8c4c/32.png) [@nad](https://www.ruby-forum.com/u/nad)\
**Post date:** [January 8, 2008, 4:57am UTC](https://www.ruby-forum.com/t/problem-with-drop-down-list/125312/1 "2008-01-08T04:57:59Z")

</div>

Hi ,

i have two drop down list where the data of it retrieve from the DB  
table. this one is working 100% .

bt now i want do some thin like this.  
when the fist drop down list is selected the second one values should be  
change according to that.

```
* for example when the county is been selected according to that

```

country the States drop down list must be change.

If some one knows how to do this pls reply.

Thanks  
Nadeesha

---

<div class="post-metadata">

**Author:** ![nad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ed8c4c/32.png) [@nad](https://www.ruby-forum.com/u/nad)\
**Post date:** [January 8, 2008, 5:30am UTC](https://www.ruby-forum.com/t/problem-with-drop-down-list/125312/2 "2008-01-08T05:30:01Z")

</div>

You can use an AJAX request to go to another page that will give you  
back  
some options for that other select box using an RJS request:

other\_page.rjs  
page.replace\_html “other\_select\_box”, options\_for\_select(@options)

On Jan 8, 2008 2:27 PM, Nadeesha M. \<  
removed\_email\_address@domain.invalid\> wrote:

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

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.

---

<div class="post-metadata">

**Author:** ![nad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ed8c4c/32.png) [@nad](https://www.ruby-forum.com/u/nad)\
**Post date:** [January 8, 2008, 5:38am UTC](https://www.ruby-forum.com/t/problem-with-drop-down-list/125312/3 "2008-01-08T05:38:54Z")

</div>

Ryan B. wrote:

> You can use an AJAX request to go to another page that will give you  
> back  
> some options for that other select box using an RJS request:
> 
> other\_page.rjs  
> page.replace\_html “other\_select\_box”, options\_for\_select(@options)
> 
> On Jan 8, 2008 2:27 PM, Nadeesha M. \<  
> removed\_email\_address@domain.invalid\> wrote:
> 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > >
> 
> –  
> Ryan B.  
> [http://www.frozenplague.net](http://www.frozenplague.net)  
> Feel free to add me to MSN and/or GTalk as this email.

Hi Ryan

Thanks for the tips.

bt i have little problem. bz still i did not able to figer out how this  
AJAX things works.(I am new to this ROR 🙂 ) . so could be give some  
example or some more guide line for this. (Sorry to trouble u PAL).

If ok pls send ur GTalk ID

Thanks  
Nadeesha

(removed\_email\_address@domain.invalid)
