From 5b40eff0fa588e11c431976f3d3faa3e2952e412 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jan 2014 18:30:35 +0100 Subject: [PATCH] Fix: W3C. Input fields can be between a table and tr tag. --- htdocs/core/class/html.form.class.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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";