Forum: Ruby on Rails collection_select & selected value

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
39025a7f572d6fe464e1fe6be399ca3b?d=identicon&s=25 Mike Dershowitz (mdersh53)
on 2007-01-27 16:40

I have the following view code:

<%= f.collection_select :goaltype_id, Goaltype.find(:all), :id, :name,
 { :onchange => "new Effect.SlideDown('onetime'); return false;", :style
=> "width:200px", :multiple => true } %>
<div id="onetime" style="display: none">
  <%= render(:partial => "g_onetime" ) %>

What I'd like to do is to capture the value that the user selected and
then use it to determine which div to display.  Right now this works
just fine in displaying only the one div "onetime", but I need it to be
more robust and determine which div to select based on what value the
user chooses in the drop-down.

Do I need a listener or something?

Thanks in advance!

39025a7f572d6fe464e1fe6be399ca3b?d=identicon&s=25 Mike Dershowitz (mdersh53)
on 2007-01-28 15:32
(Received via mailing list)
Any thoughts on this? Any help folks can provide would be greatly

On Jan 27, 10:40 am, Mike Dershowitz <rails-mailing-l...@andreas-
This topic is locked and can not be replied to.