2
0
forked from Wavyzz/dolibarr

Fix js error

This commit is contained in:
Laurent Destailleur
2021-02-14 21:32:19 +01:00
parent 9e16cd5b77
commit 2cc4632a39
2 changed files with 6 additions and 2 deletions

View File

@@ -500,7 +500,9 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
if (response.num) {
var selecthtml_str = response.value;
var selecthtml_dom=$.parseHTML(selecthtml_str);
$("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
if (typeof(selecthtml_dom[0][0]) !== \'undefined\') {
$("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
}
} else {
$("#inputautocomplete"+htmlname).val("");
}