0

I have an interesting question, i hope..I have a textarea in my form..when a user comes to enter values in it it displays some cached values in an autocomplete format..thats fine..I want to call an ajax function after the user selects such a cached value in it..so that the ajax call should pass this selected value..so my question is on which can i get the final selected value, so i call ajax at that time,... i tried with onblur etc, but not worked..

help please.. thanks in advance...

soorajthomas
  • 273
  • 2
  • 3
  • 12

3 Answers3

0

If the user chooses by clicking, you want a 'click' handler on the element the user is selecting (or a containing element).

If the user can select in other ways, eg by the keyboard, then you'll need to observe other events as well.

Colin Fine
  • 3,334
  • 1
  • 20
  • 32
  • I don't think selecting an element from an autocomplete lookup counts as a `click` event on the text input. – Pekka Aug 17 '10 at 14:06
  • No, it isn't a click on the text input. It is a click on the element selected. In scriptaculous AutoComplete (which is the only one I have used) the options are
  • elements inside a
    which is hidden until the autocomplete is used: you can put a 'click' handler on that
    . I don't know how the autocompleter you are using organises its data, but if it is displaying items they have DOM elements, and in principle you can set event handlers on those elements.
  • – Colin Fine Aug 18 '10 at 08:55