From ebced96dcea9ae72f9fee6cab9195a075eca4393 Mon Sep 17 00:00:00 2001 From: "peter.janssens" Date: Wed, 18 Feb 2026 11:36:41 +0100 Subject: [PATCH] use both label and value in lookup autocomplete --- .../Values/InformationServiceAttributeValue.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/lib/Attributes/Values/InformationServiceAttributeValue.php b/app/lib/Attributes/Values/InformationServiceAttributeValue.php index 0446deff0f..6bd26f9e3b 100644 --- a/app/lib/Attributes/Values/InformationServiceAttributeValue.php +++ b/app/lib/Attributes/Values/InformationServiceAttributeValue.php @@ -444,10 +444,12 @@ public function htmlFormElement($pa_element_info, $pa_options=null) { }); }, html: true, - select: function(event, ui) {".((!$pb_for_search) ? " - jQuery('#{fieldNamePrefix}".$pa_element_info['element_id']."_{n}').val(ui.item.label + '|' + ui.item.idno + '|' + ui.item.url);" : - "jQuery('#{fieldNamePrefix}".$pa_element_info['element_id']."_{n}').val(ui.item.label);" - )." + select: function(event, ui) { + if(ui.item.value=='')ui.item.value=ui.item.label; + ".((!$pb_for_search) ? " + jQuery('#{fieldNamePrefix}".$pa_element_info['element_id']."_{n}').val(ui.item.value + '|' + ui.item.idno + '|' + ui.item.url);" : + "jQuery('#{fieldNamePrefix}".$pa_element_info['element_id']."_{n}').val(ui.item.value);" + )." } } ).click(function() { this.select(); });