Hi all,

I'm building a module for a website I'm working on and I would like to have a form that contains various input fields but also one information field. Here is a snippit of code:

function howdoi_genform($list)
{
        for ( $i=0 ; $i < 10 ; $i++ )
        {
                $userfriendlyi = $i + 1;
                $form["question$i"] = array('#type' => 'textfield', '#required' => FALSE, '#default_value' => $list[$i][question], '#size' => 30, '#maxlength' => 30);
                $form["url$i"] = array('#type' => 'textfield', '#required' => FALSE, '#default_value' => $list[$i][url], '#size' => 50, '#maxlength' => 50);
                $form["total$i"] = array('#type' => 'value', '#value' => $list[$i][total]);
                $form["clear$i"] = array('#type' => 'checkbox', '#default_value' => 0);
                $form["id$i"] = array('#type' => 'hidden', '#value' => $list[$i][id]);
        }
        $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));

  return $form;
}

Basically I'm trying to build a form with 10 sets of information. This works great except for the total for each set. It seems to be set correctly in the form because I can see the correct value for total when I use var_dump on the form. My problem comes when I try to theme the form:

function theme_howdoi_edit($form)
{

        $output = '<table border="0"><th>Question</th><th>URL</th><th>Hits Total</th><th>Clear Total?</th>';
        for ( $i=0 ; $i < 10 ; $i++ )
        {
                $output .= '<tr>';
                $output .= '<td>' . form_render($form["question$i"]) . '</td>';
                $output .= '<td>' . form_render($form["url$i"]) . '</td>';
                $output .= '<td align="center">' . form_render($form["total$i"]) . '</td>';
                $output .= '<td align="center">' . form_render($form["clear$i"]) . '</td>';
                $output .= '</tr>';


        }

        $output .= '</table>';
        $output .= form_render($form);

        return $output;

}

When I then load the proper page, I see all the elements except for the totals. When I view the source there is no mention of totals anywhere. It seems form_render doesn't find or output anything for$form["total$i"].

Can anyone comment on where I'm going wrong here? I'm just trying to display some numbers and I'd rather not have to run another database query in the theme function.