Forum: Ruby on Rails forcing onChange in a partial

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.
JannaB (Guest)
on 2009-05-27 19:01
(Received via mailing list)
I have a partial view which incorporates on onChange option in a form.
It works great when I actually change the select box which it is an
option to. However, when the div which contains this partial first
shows, the onChange doesn;t fire. How can I force this to fire when it
is first shown? Thanks Janna B,

<%= f.label :country %><br />
  <%= f.country_select :country, Carmen.default_country, {},
      :onChange => remote_function( :url => { :action =>
'_get_states' }, :update => "state", :with => "'country=' +value")
    } %>
This topic is locked and can not be replied to.