You could try this, similar to what the plugin does for the mustMatch option:
$(".autocomplete").blur(function() { $(this).search(function(result) { if (!result) { // no match found, do something, eg. clearing other fields } }); }); Jörn On Tue, Aug 11, 2009 at 8:30 PM, Ash<ash.sea...@gmail.com> wrote: > > Does anyone have a library or patch to call a handler if a user leaves > an autocomplete field without choosing one of the autocomplete options > - i.e. they've entered free text. > > I'm working with an app that populates multiple fields from a single > auto-complete value, and our latest requirement is to clear out a > bunch of fields if the user's entered something manually - rejecting > autocomplete suggestions. > > My initial attempts at hooking into onkeyfoo and onblur haven't lead > anywhere productive, and I'm hoping someone else has managed to > overcome the gnarly event and timing dependencies involved with > onkeyfoo and blur being used for standard autocomplete behaviour. > > Note: I'm working with http://plugins.jquery.com/project/autocompletex > - but I'm happy to switch libraries and/or port functionality and > patches over from another solution. >