http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter
afterUpdateElement function... you receive an input object and some element that was representing the field. At this point you could execute form.submit.. -- http://positionabsolute.net On Oct 7, 11:19 am, Yogesh <[email protected]> wrote: > Hello, > > I am using Ajax.autocompleter in one of my forms. I am calling a > custom function getSelectedId after update element to get an ID of the > selected list item. > > I need a functionality such that form should get submitted whenever : > 1) a user clicks a item using mouse from the autosuggest list. > 2) Whenever user presses enter key while a list item is selected. > (This I have achieved through a hack as shown in code below. I > call .submit() after getSelectedId function) > > I don't know how to submit the form on mouse click. Any help on this > issue will be really helpful to me. > > <script type="text/javascript"> > new Ajax.Autocompleter("search","hint","server_class.php", > {afterUpdateElement : getSelectedId, minChars:1}); > function getSelectedId(text, li) { > $('class_id').value=li.id; > document.forms['searchcustomerform'].submit(); > } > </script> > > Thank you. > > Sincerely, > Yogesh --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
