diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 05495f527c7..3d208d80eb2 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -7896,6 +7896,7 @@ class Form
}
// Preparing gender's display if there is one
+ $addgendertxt = '';
if ($object->gender) {
$addgendertxt = ' ';
switch ($object->gender) {
@@ -7909,7 +7910,7 @@ class Form
$addgendertxt .= '';
break;
}
- } else $addgendertxt = '';
+ }
// Add where from hooks
if (is_object($hookmanager)) {