I''ve two questions regarding auto_complete... First: On the Script.aculo.us demonstration at http://script.aculo.us/demos/ajax/autocompleter_customized, the script appears to transparently select a single one of the divs in the results loop to drop into the <input> field. On my app, it tries to insert the entire set of divs. How do you specify which part of the result should be dropped into the <input>? Second: Is there an easy way to, when the user presses Return to select one of the results, have it (for example) go to a URL instead of just dropping that <li> into the <input>? Thanks, -- Chris Johnson cj-lHH7W0eyjmpWk0Htik3J/w@public.gmane.org
> First: > > On my app, it tries to insert the entire set of divs. How do you > specify which part of the result should be dropped into the <input>?The autocompleter will use all text nodes from all nodes the LI has not marked as CSS class "informal". Note that "informal" is fixed for now. From the code: value = Element.collectTextNodesIgnoreClass(this.get_current_entry(), ''informal'').unescapeHTML();> Second: > > Is there an easy way to, when the user presses Return to select one of > the results, have it (for example) go to a URL instead of just > dropping that <li> into the <input>?Use observe_field (or the Prototype classes Form.Element.Observer/ Form.Element.EventObserver) for now (as it''s just a normal text input field the autocompleter fills), user-defined callbacks are on the todo list... :) -- Thomas