diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index b7971d52c53ab273a381faa3ac9b981e2d6ce604..9de656fc44e815e59ea278473d7b851350d708e3 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -362,8 +362,12 @@ class FormOther if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname); - $nodatarole=' data-role="none"'; + $htmlforcombo = ajax_combobox($htmlname); + if ($htmlforcombo) + { + $out.= $htmlforcombo; + $nodatarole=' data-role="none"'; + } } // Select each sales and print them in a select input $out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>'; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index c891ee60a261445f37eb6dce3460aeb5ad8610d0..7508c214d838319a2619bbe8db7c18c2ce98284e 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -314,7 +314,7 @@ function ajax_dialog($title,$message,$w=350,$h=150) * @param string $htmlname Name of html select field * @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete - * @return string Return html string to convert a select field into a combo + * @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason. */ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) { @@ -323,8 +323,8 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works) if (! empty($conf->dol_use_jmobile)) return ''; // combobox with jmobile (does not works) if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; - if (empty($conf->use_javascript_ajax)) return ''; - + if (empty($conf->use_javascript_ajax)) return ''; + /* Some properties for combobox: minLengthToAutocomplete: 2, comboboxContainerClass: "comboboxContainer",