I have a page with a collection_select, populated by an array of info
pulled form a MySQL table. Trying to get some text_fields to update
with information from this array depending on which item was selected
from the collection select.
Currently, with the @nonUsers[2].fullName section i'm able to get the
text_field to populate with the fullName of the second item, but i'm
struggling as to make this dynamic. Please help.
I have a page with a collection_select, populated by an array of info
pulled form a MySQL table. Trying to get some text_fields to update
with information from this array depending on which item was selected
from the collection select.
Currently, with the @nonUsers[2].fullName section i'm able to get the
text_field to populate with the fullName of the second item, but i'm
struggling as to make this dynamic. Please help.
Your rjs (ie update_page) is just generating a static blob of
javascript, it's much easier to get rid of that crutch and just write
the javascript yourself, something like $('userName').value = $F
('person_convert') (assuming you are using prototype).