Hi everyone, I''ve got auto complete working on a text field a la http:// script.aculo.us/demos/ajax/autocompleter_customized, but when I hit Enter, the field is populated with one of the labels from the auto complete div. What I''d like is to somehow get the record id for that item and pass it on to the next action in the workflow (in this case, a simple ''show''). How can I go about that? Assuming that the label is unique and can be used to search isn''t really an option. I think. Maybe you''ll tell me otherwise. :) Thanks, Sean ------- Sean Hussey Web Database Specialist Berklee College of Music 617-747-2926
I don''t think this is currently supported since the underlying js code doesn''t. This is actually on wish list (http://wiki.script.aculo.us/scriptaculous/show/TheWishlist) On 8/25/05, Sean Hussey <shussey-P6oFqSfzpKaVc3sceRu5cw@public.gmane.org> wrote:> Hi everyone, > > I''ve got auto complete working on a text field a la http:// > script.aculo.us/demos/ajax/autocompleter_customized, but when I hit > Enter, the field is populated with one of the labels from the auto > complete div. What I''d like is to somehow get the record id for that > item and pass it on to the next action in the workflow (in this case, > a simple ''show''). > > How can I go about that? Assuming that the label is unique and can > be used to search isn''t really an option. I think. Maybe you''ll > tell me otherwise. :) > > Thanks, > > Sean > > ------- > Sean Hussey > Web Database Specialist > Berklee College of Music > 617-747-2926 > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Aug 25, 2005, at 13:52, Sean Hussey wrote:> I''ve got auto complete working on a text field a la http:// > script.aculo.us/demos/ajax/autocompleter_customized, but when I hit > Enter, the field is populated with one of the labels from the auto > complete div. What I''d like is to somehow get the record id for > that item and pass it on to the next action in the workflow (in > this case, a simple ''show''). > > How can I go about that? Assuming that the label is unique and can > be used to search isn''t really an option. I think. Maybe you''ll > tell me otherwise. :)What do you do if the user enters a (valid/unique/whatever) label and presses enter before the auto-completion finishes? It seems to me like you have to handle getting the label rather than the ID anyway (even if it''s just showing another screen where the user clicks on their choice or some such). - ask -- http://askask.com/ - http://develooper.com/
Hmm, good point. Is this how others are dealing with this? Can anyone else comment on what they''re doing? Thanks! Sean On Aug 25, 2005, at 10:04, Ask Bjørn Hansen wrote:> What do you do if the user enters a (valid/unique/whatever) label > and presses enter before the auto-completion finishes? > > It seems to me like you have to handle getting the label rather > than the ID anyway (even if it''s just showing another screen where > the user clicks on their choice or some such).------- Sean Hussey Web Database Specialist Berklee College of Music 617-747-2926 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Friday 26 August 2005 04:10, Sean Hussey wrote:> Hmm, good point. Is this how others are dealing with this? Can > anyone else comment on what they''re doing?Simple: I''m not using the Rails/scriptaculous autocompletion code, even though I would like to, but I can''t do without an id. Text alone just isn''t good enough. Therefore I have my own widget for choosing the target of an association where I display matches in a select element. That way I can use the foreign keys as values of the options. Michael -- Michael Schuerig The Fifth Rider of the Apocalypse mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org is a programmer. http://www.schuerig.de/michael/
Sean Hussey wrote:> Hi everyone, > > I''ve got auto complete working on a text field a la http:// > script.aculo.us/demos/ajax/autocompleter_customized, but when I hit > Enter, the field is populated with one of the labels from the auto > complete div. What I''d like is to somehow get the record id for that > item and pass it on to the next action in the workflow (in this case, > a simple ''show''). > > How can I go about that? Assuming that the label is unique and can > be used to search isn''t really an option. I think. Maybe you''ll > tell me otherwise. :) > > Thanks, > > Sean > > ------- > Sean Hussey > Web Database Specialist > Berklee College of Music > 617-747-2926 > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >My autocomplete function returns names in this format "#{last_name}, #{first_name} (#{id})". In example, "Smith, John (23546)". The form handler only looks for the number. -- Jack Christensen jackc-/SOt/BrQZzOj3I+7jmQ39gC/G2K4zDHf@public.gmane.org