If you are looking for autocomplete through ajax , here is the solution.
//this will be set true only if fetched via ajax and also selected from autocomplete $.is_ajax_fetched = false;
Inside autocomplete you will need the following events:
select: function( event, ui ) { $.is_ajax_fetched = true; return true; }, //select event will not work alone as tag-it captures event to check for comma and other stuff close: function( event, ui ) { if($.is_ajax_fetched == true){ $('.ui-autocomplete-input').blur(); $('.ui-autocomplete-input').focus(); } }
Now in the tag-it call, you will need to add the call events to the options:
beforeTagAdded: function(event, ui) { if($.is_ajax_fetched != true){return false;} }, afterTagAdded: function(event, ui) { $.is_ajax_fetched = false; },
source share