Hi Ian,
Maybe you could add an :after_update_element to your
text_field_with_auto_complete, e.g.
<%= text_field_with_auto_complete :model, :method,
{}, :after_update_element => ''getAddresses'' %>
Then define a Javascript function to your head which calls
Ajax.Updater like:
function getAddresses(text, li) {
new Ajax.Updater(''mydiv'', ''/foo/bar/'' +
text, {asynchronous:true});
}
Where bar is a new action in your controller which returns your
addresses into a div named mydiv.
Hope that helps. You can find more on the rails and scriptaculous
wikis although they both seem to be down at the moment(!)
On 1 Dec 2006, at 14:33, Ian Gi wrote:
>
>
> I have a text_field_with_auto_complete which returns a number of
> names.
> Upon selecting a name I wish to then populate a drop down menu with
> all
> database records associated with this name (lets say addresses) e.g. 1
> Name has Multiple Addresses.
>
> I can''t figure out a way of triggering this 2nd event, is it
possible?
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
--
Mark
This message has been scanned for viruses by MailControl - www.mailcontrol.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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---