我创建了一个包含多个文本字段的表单。文本字段从数据库中获取默认值。表格在表格中,但有些单元格消失了。这很奇怪,因为当我更改数据库中的某些值时,它们可能会出现。任何人都可以帮忙吗?
$matches = competition_entry_load();
$form['namefield'] = array(
'#type' => 'fieldset',
'#title' => t('check'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
foreach ($matches as $key=>$entry) {
$A1 = $entry->A1;
$AX = $entry->AX;
$A2 = $entry->A2;
$home_team = $entry->home_team;
$away_team = $entry->away_team;
$form['namefield'][$A1] = array(
'#type' => 'textfield',
'#default_value' => $A1,
'#size' => 6,
'#maxlength' => 6,
'#prefix' => '<table border=0 cellspacing=30 celladding=30><tr><td><center>',
'#suffix' => '</center></td>',
);
$form['namefield'][$AX] = array(
'#type' => 'textfield',
'#default_value' => $AX,
'#size' => 4,
'#maxlength' => 4,
'#prefix' =>'<td><center>',
'#suffix' => '</center></td>',
);
$form['namefield'][$A2] = array(
'#type' => 'textfield',
'#default_value' => $A2,
'#title'=> t($A2),
'#size' => 4,
'#maxlength' => 4,
'#prefix' =>'<td><center>',
'#suffix' => '</center></td>',
);
$form['namefield'][$home_team] = array(
'#type' => 'textfield',
'#default_value' => $entry->home_team,
'#size' => 15,
'#maxlength' => 15,
'#prefix' =>'<td><center>',
'#suffix' => '</center></td>',
);
$form['namefield'][$away_team] = array(
'#type' => 'textfield',
'#default_value' => $entry->away_team,
'#size' => 15,
'#maxlength' => 15,
'#prefix' =>'<td><center>',
'#suffix' => '</center></td>',
);
$form['namefield']['skorH_'.$home_team] = array(
'#type' => 'textfield',
'#size' => 1,
'#maxlength' => 1,
'#prefix' =>'<td><center>',
'#suffix' => '</center></td>',
);
$form['namefield']['skorA_'.$home_team] = array(
'#type' => 'textfield',
'#size' => 1,
'#maxlength' => 1,
'#prefix' =>'<td><center>',
'#suffix' => '</center></td></tr></table>',
);
}
return $form;
}