diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index c51106bf7..42e1c7051 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1126,7 +1126,7 @@ EOF $sHTMLValue = " {$sValidationField}"; // another hidden input to store & pass the object's Id $sHTMLValue .= "\n"; - $oPage->add_ready_script("\$('#label_$iId').autocomplete('./ajax.render.php', { scroll:true, minChars:3, onItemSelect:selectItem, onFindValue:findValue, formatItem:formatItem, autoFill:true, keyHolder:'#$iId', extraParams:{operation:'autocomplete', sclass:'$sClass',attCode:'".$sAttCode."'}});"); + $oPage->add_ready_script("\$('#label_$iId').autocomplete('./ajax.render.php', { scroll:true, minChars:3, formatItem:formatItem, autoFill:true, keyHolder:'#$iId', extraParams:{operation:'autocomplete', sclass:'$sClass',attCode:'".$sAttCode."'}});"); $oPage->add_ready_script("\$('#label_$iId').blur(function() { $(this).search(); } );"); $oPage->add_ready_script("\$('#label_$iId').result( function(event, data, formatted) { OnAutoComplete('$iId', event, data, formatted); } );"); $aEventsList[] ='change'; diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index 83cc72a0d..efc0641e6 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -359,24 +359,6 @@ EOF // } // } - // For automplete - function findValue(li) { - if( li == null ) return alert("No match!"); - - // if coming from an AJAX call, let's use the CityId as the value - if( !!li.extra ) var sValue = li.extra[0]; - - // otherwise, let's just display the value in the text box - else var sValue = li.selectValue; - - //alert(\"The value you selected was: \" + sValue); - } - - function selectItem(li) { - findValue(li); - } - - function formatItem(row) { return row[0]; }