# How to use switchdiv( ) method in views?

**URL:** <https://www.ruby-forum.com/t/how-to-use-switchdiv-method-in-views/155840>\
**Category:** Rails\
**Created:** [December 17, 2008, 11:28am UTC](https://www.ruby-forum.com/t/how-to-use-switchdiv-method-in-views/155840 "2008-12-17T11:28:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@srikanth](https://www.ruby-forum.com/u/srikanth)\
**Post date:** [December 17, 2008, 11:28am UTC](https://www.ruby-forum.com/t/how-to-use-switchdiv-method-in-views/155840/1 "2008-12-17T11:28:53Z")

</div>

I have four tables called:  
video  
audio  
image  
audio  
each table ia having differnet parameters.

While iam uploading new stream i can choose video/audio/image/audio  
and i can update corresponding table params;  
Here I am using switchdiv() method to do swith between ldifferent  
table parameters like below:

```
                  <select name="content" onchange="switchDiv

```

(value);"\>  
Video  
Image  
Speech  
Audio

the above code will create a dropdown box with video,audio,image and  
speech params.

Here what i want to do is instead of using “value” param in the above  
code i want to use the paarams selected by using below method:  
collection\_select(:stream, :connenttype\_id, @connenttypes, :id, :name)  
%\>

with this code i am getting dropdown box of video,audio,image and  
speech params.  
Now if i select “video” parameter from dropdown box ,how to link this  
parameter to the  
switchDiv(value) method in the place of “value”.

Can any one give the suggestions or help to do the same.

thanks  
srikanth
