Qual: flush cache if field is empty

This commit is contained in:
Regis Houssin
2010-10-11 13:29:11 +00:00
parent 668bc945dd
commit 1a893d4d0d

View File

@@ -91,6 +91,7 @@ function ajax_autocompleter($selected='',$htmlname,$url,$option='')
var cache = {};
jQuery("input#search_'.$htmlname.'").autocomplete({
source: function( request, response ) {
if (this.length == 0) { jQuery(this).flushCache(); }
if (cache.term == request.term && cache.content) {
response(cache.content);
return;