diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8c1c4ac7987..f2a3ea58754 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2525,6 +2525,19 @@ class Form if (is_array($formquestion) && ! empty($formquestion)) { + // First add hidden fields and value + foreach ($formquestion as $key => $input) + { + if (is_array($input) && ! empty($input)) + { + if ($input['type'] == 'hidden') + { + $more.=''."\n"; + } + } + } + + // Now add questions $more.=''."\n"; $more.=''."\n"; foreach ($formquestion as $key => $input) @@ -2584,10 +2597,6 @@ class Form $more.=$input['value']; $more.=''."\n"; } - else if ($input['type'] == 'hidden') - { - $more.=''; - } } } $more.='
'.(! empty($formquestion['text'])?$formquestion['text']:'').'
'."\n";