Bill,
I have a collection select that shows a list of users:
<%= collection_select(:person, :convert, @nonUsers, :id, :fullName,
{:prompt => "Choose..."}, :style => "width:125px;") %>
And a text field:
<%= text_field_tag :userName %>
When a user is selected I'm trying to pull that user out of a array
variable that I already have set up, @nonUsers (used to populate the
collection_select), and have that user's userName put into the text box.
I can't seem to figure out how to access the value of what's been
selected with an observe_field.
(Trying to do all this with RJS and not make a post back to the server).
My observe_field looks like:
<%= observe_field "person_convert", :function => update_page {|page|
page["userName"].value = @nonUsers.select{|p| p.id == ***** }.collect{
|p| p.fullName } }%>
BUT I'm not sure what to put in place of the ***** to get that
collection_select's selected value.
--
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
-~----------~----~----~----~------~----~------~--~---