diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 67d2d96883d..29fcbf81180 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3389,6 +3389,8 @@ class Form
function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0, $disabled=0)
{
global $langs;
+
+ if ($value_as_key) $array=array_combine($array, $array);
$out='