Rails List wrote:
> I have two dropdowns 'a' and 'b'. when something is selected on 'a',
> its onchange event has an action and an update area which works fine.
>
> but when it comes to editing a record, i am able to list items in 'a'
> dropdown and select the current value but this leave 'b' dropdown empty.
>
> i would like to trigger an onchange or onclick event for 'a's selected
> value so that 'b' drop down is populated correctly.
>
> any ideas?
You can use observe_field which observe 'a' select tag and change the
values of 'b'.
Example :
select_tag "country", "<option>XYZ</option>"
observe_field 'country',:url => { :controller => 'location', :action =>
'location_chooser' },:on => 'click', :with => :q
google more on observe_field and select_tag.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---