# Drop down list with AJAX(?)

**URL:** <https://www.ruby-forum.com/t/drop-down-list-with-ajax/104408>\
**Category:** Rails\
**Created:** [May 17, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/drop-down-list-with-ajax/104408 "2007-05-17T17:10:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [May 17, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/drop-down-list-with-ajax/104408/1 "2007-05-17T17:10:30Z")

</div>

Hi,

I’ve been trying to create a specific drop down list. The list, apart  
from normal elements read from a database, should have additional  
element called ‘Other.’ which when selected should cause the drop down  
list to disappear and change to a standard text area in which the user  
can input whatever he wants.

The first part is super simple. The ‘select’ method makes the drop down  
list  
flawlessly but I can’t figure out how to switch the drop down list with  
a text area. I’m guessing you should use AJAX, but as my knowledge of it  
is very low I was wondering if there is a substitute method that makes  
it possible (cause this idea seems pretty commonly used). If not, can  
someone point to the specific methods that can make this possible, or  
even better - a working example. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![asetzler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Post date:** [May 17, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/drop-down-list-with-ajax/104408/2 "2007-05-17T19:45:49Z")

</div>

Adam Sosnowski wrote:

> Hi,
> 
> I’ve been trying to create a specific drop down list. The list, apart  
> from normal elements read from a database, should have additional  
> element called ‘Other.’ which when selected should cause the drop down  
> list to disappear and change to a standard text area in which the user  
> can input whatever he wants.
> 
> The first part is super simple. The ‘select’ method makes the drop down  
> list  
> flawlessly but I can’t figure out how to switch the drop down list with  
> a text area. I’m guessing you should use AJAX, but as my knowledge of it  
> is very low I was wondering if there is a substitute method that makes  
> it possible (cause this idea seems pretty commonly used). If not, can  
> someone point to the specific methods that can make this possible, or  
> even better - a working example. Thanks 🙂

1. Use

Other
1. Use

Other 

where the remote\_function part is standard update-an-element with  
server-generated code.

Sorry this is a bit scanty. If you provide more details maybe we can  
fill in the missing pieces.

Stephan
