If you have an autocomplete and you have several text fields that have the other columns from the db. How do you autocomplete on a box and when you select it it fills in the other text fields with the rest of the data from the table?
When the autocomplete value is selected do an ajax call to your application returning the data you need to fill in using a format you can parse in JavaScript like JSON and set the form values. On May 29, 12:36 am, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you have an autocomplete and you have several text fields that have > the other columns from the db. > > How do you autocomplete on a box and when you select it it fills in > the other text fields with the rest of the data from the table?
ok where do I do that at? On Fri, May 29, 2009 at 11:29 AM, jay <jaypowers-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > When the autocomplete value is selected do an ajax call to your > application returning the data you need to fill in using a format you > can parse in JavaScript like JSON and set the form values. > > > On May 29, 12:36 am, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > If you have an autocomplete and you have several text fields that have > > the other columns from the db. > > > > How do you autocomplete on a box and when you select it it fills in > > the other text fields with the rest of the data from the table? > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Chris Habgood wrote:> ok where do I do that at?Have you tried googling for instructions? When I try: http://www.google.com/search?q=rails+autocomplete The first hit is: http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html Seems to me to tell you exactly what you are asking. -- Posted via http://www.ruby-forum.com/.
OK, pardon my ignorance I guess. Should I do set an instance variable for the output then use that in the RJS to populate the rest of the text_fields with the other data? Seems that is the way to go. On May 31, 9:56 pm, Jonathan Rochkind <rails-mailing-l...@andreas- s.net> wrote:> Chris Habgood wrote: > > ok where do I do that at? > > Have you tried googling for instructions? > > When I try: > > http://www.google.com/search?q=rails+autocomplete > > The first hit is: > > http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-i... > > Seems to me to tell you exactly what you are asking. > -- > Posted viahttp://www.ruby-forum.com/.
Actually, sorry, that page indeed didn''t answer your question. Try this one though. Googled for "rails autocomplete multiple values" http://www.wayne-robinson.com/journal/2006/11/11/multiple-values-from-scriptaculous-autocomplete.html This is not something I''ve done myself before though, sorry. -- Posted via http://www.ruby-forum.com/.
WOW, that is cool. I cannot thank you enough. I guess I will learn to google properly. Never though of asking for the obvious. DOH!! On Sun, May 31, 2009 at 10:22 PM, Jonathan Rochkind < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Actually, sorry, that page indeed didn''t answer your question. Try this > one though. Googled for "rails autocomplete multiple values" > > > http://www.wayne-robinson.com/journal/2006/11/11/multiple-values-from-scriptaculous-autocomplete.html > > This is not something I''ve done myself before though, sorry. > -- > 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 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 -~----------~----~----~----~------~----~------~--~---