Fix: auto select if only one but with view the entire label

This commit is contained in:
Regis Houssin 2010-10-11 10:49:55 +00:00
parent c222f45bef
commit f0086b3ced

View File

@ -95,10 +95,9 @@ function ajax_autocompleter($selected='',$htmlname,$url,$option='')
if (data.length == 1) { if (data.length == 1) {
jQuery("#search_'.$htmlname.'").val(item.value); jQuery("#search_'.$htmlname.'").val(item.value);
jQuery("#'.$htmlname.'").val(item.key); jQuery("#'.$htmlname.'").val(item.key);
} else { }
var label = item.label.toString().replace(new RegExp("("+request.term+")","i"),"<strong>$1</strong>"); var label = item.label.toString().replace(new RegExp("("+request.term+")","i"),"<strong>$1</strong>");
return { label: label, value: item.value, id: item.key} return { label: label, value: item.value, id: item.key}
}
})); }));
}, "json"); }, "json");
}, },