grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 $selector, 'type' => 'GET', 'url' => JUri::root() . 'index.php?option=com_tags&task=tags.searchAjax', 'dataType' => 'json', 'jsonTermKey' => 'like', 'minTermLength' => $minTermLength ) ); JHtml::_('formbehavior.ajaxchosen', $chosenAjaxSettings); // Allow custom values? if ($allowCustom) { JFactory::getDocument()->addScriptDeclaration( " jQuery(document).ready(function ($) { var customTagPrefix = '#new#'; function tagHandler(event,element) { // Search a highlighted result var highlighted = $('" . $selector . "_chzn').find('li.active-result.highlighted').first(); // Add the highlighted option if (event.which === 13 && highlighted.text() !== '') { // Extra check. If we have added a custom tag with element text remove it var customOptionValue = customTagPrefix + highlighted.text(); $('" . $selector . " option').filter(function () { return $(element).val() == customOptionValue; }).remove(); // Select the highlighted result var tagOption = $('" . $selector . " option').filter(function () { return $(element).html() == highlighted.text(); }); tagOption.attr('selected', 'selected'); } // Add the custom tag option else { var customTag = element.value; // Extra check. Search if the custom tag already exists (typed faster than AJAX ready) var tagOption = $('" . $selector . " option').filter(function () { return $(element).html() == customTag; }); if (tagOption.text() !== '') { tagOption.attr('selected', 'selected'); } else { var option = $('