From f0086b3cedef02c761caffd3a18bae4405f19143 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Oct 2010 10:49:55 +0000 Subject: [PATCH] Fix: auto select if only one but with view the entire label --- htdocs/lib/ajax.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/ajax.lib.php b/htdocs/lib/ajax.lib.php index 83ce3292704..a0c6b6b0e01 100644 --- a/htdocs/lib/ajax.lib.php +++ b/htdocs/lib/ajax.lib.php @@ -95,10 +95,9 @@ function ajax_autocompleter($selected='',$htmlname,$url,$option='') if (data.length == 1) { jQuery("#search_'.$htmlname.'").val(item.value); jQuery("#'.$htmlname.'").val(item.key); - } else { - var label = item.label.toString().replace(new RegExp("("+request.term+")","i"),"$1"); - return { label: label, value: item.value, id: item.key} } + var label = item.label.toString().replace(new RegExp("("+request.term+")","i"),"$1"); + return { label: label, value: item.value, id: item.key} })); }, "json"); },