# Show div on selection from dropdown

**URL:** <https://www.ruby-forum.com/t/show-div-on-selection-from-dropdown/174715>\
**Category:** Rails\
**Created:** [August 31, 2009, 10:13pm UTC](https://www.ruby-forum.com/t/show-div-on-selection-from-dropdown/174715 "2009-08-31T22:13:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [August 31, 2009, 10:13pm UTC](https://www.ruby-forum.com/t/show-div-on-selection-from-dropdown/174715/1 "2009-08-31T22:13:19Z")

</div>

This might be more of an HTML general question, but I have been trying  
to find a “rails” way to do this and have come up short. What I want to  
do is to have a div appear if a certain selection from a drop-down is  
selected or dissapeare if another option is selected. Here is what I  
have:

 \>Admin onselect = "alert('TEST'); document.getElementById('agency\_admin\_div').style.display = '';"\> Agency Admin \>Agent \>Travel Manager \>Traveler

This doesn’t work, and I have been unable to find an oppropriate rails  
or html example that gives me what I want. I have done similar things  
with rails helpers before but never with the “select” tag. Anybody have  
any suggestions? Thanks,

-S
