# Displaying Dropdown list value on selection of other dropdown list

**URL:** <https://www.ruby-forum.com/t/displaying-dropdown-list-value-on-selection-of-other-dropdown-list/143614>\
**Category:** Rails\
**Created:** [July 21, 2008, 8:05am UTC](https://www.ruby-forum.com/t/displaying-dropdown-list-value-on-selection-of-other-dropdown-list/143614 "2008-07-21T08:05:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shripad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f17d59/32.png) [@Shripad](https://www.ruby-forum.com/u/Shripad)\
**Post date:** [July 21, 2008, 8:05am UTC](https://www.ruby-forum.com/t/displaying-dropdown-list-value-on-selection-of-other-dropdown-list/143614/1 "2008-07-21T08:05:00Z")

</div>

Hi all,

I want to do like following,

I have Zone dropdown list, which contain West Zone, South Zone etc.  
when i select a value from this, i want to display all the regions in  
the selected zone in Region dropdown.

What I have done is something like this, but it is not working good  
for me

```
  <% @r= Zone.find_by_sql("select id,ZONE_ZoneName from zones")%>

```

\<% for item in @r %\>

"\> **\<%= item.ZONE\_ZoneName -%\>** \<% end %\>

This calling the controller but the selected parameters are not pass  
to the controller

I am doing this way.

Is there any other way to do this?  
please help me, I am new to ROR

Thanks and Regards,  
Shripad

---

<div class="post-metadata">

**Author:** ![Shripad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f17d59/32.png) [@Shripad](https://www.ruby-forum.com/u/Shripad)\
**Post date:** [July 21, 2008, 12:44pm UTC](https://www.ruby-forum.com/t/displaying-dropdown-list-value-on-selection-of-other-dropdown-list/143614/2 "2008-07-21T12:44:25Z")

</div>

Hope this helps…

[http://railsforum.com/viewtopic.php?pid=64003](http://railsforum.com/viewtopic.php?pid=64003)

Thanks.

---

<div class="post-metadata">

**Author:** ![Shripad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f17d59/32.png) [@Shripad](https://www.ruby-forum.com/u/Shripad)\
**Post date:** [July 23, 2008, 10:16am UTC](https://www.ruby-forum.com/t/displaying-dropdown-list-value-on-selection-of-other-dropdown-list/143614/3 "2008-07-23T10:16:50Z")

</div>

hi Kiran,

Thanks for ur reply  
I have used what u have mentioned, but it is not solving my problem  
do u have any other solution abt this.  
What I have done for this is, i used observer\_field it is working fine  
in firefox but not working in IE do u have any solution

Thanks and regards  
Shripad

---

<div class="post-metadata">

**Author:** ![Shripad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f17d59/32.png) [@Shripad](https://www.ruby-forum.com/u/Shripad)\
**Post date:** [July 23, 2008, 3:01pm UTC](https://www.ruby-forum.com/t/displaying-dropdown-list-value-on-selection-of-other-dropdown-list/143614/4 "2008-07-23T15:01:42Z")

</div>

This railscast episode might help you. It does exactly what you’re  
asking for.

> **[\#88 Dynamic Select Menus - RailsCasts](http://railscasts.com/episodes/88-dynamic-select-menus)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

Serge
