So the client want's a table for a form questions and I am using radio buttons to allow them to select on option per row. When I attempt to use a radio button with the same name (to make it part of a group) then explode the prefix and suffix option that are used to create the table elements. What am I missing? I know the prefix and suffix is correct in building the table since I originally had it using text inputs, but when I switched it to radio buttons it blew up.

Sample of a group:

$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Full-fat cheeses or milk</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr>',
);

Full form (incase you want to see it):

$form['q8'] = array(
'#type' => 'radiobutton',
'#prefix' => '<table id="au-table" border="0" cellspacing="0" cellpadding="0"><tr><td width="129" valign="top"><p>Food Type</td><td width="94" valign="top"><p>0 servings per day</td><td width="116" valign="top"><p>1 serving per day</td><td width="118" valign="top"><p>2 servings per day</td><td width="118" valign="top"><p>3 servings per day</td><td width="118" valign="top"><p>4 servings per day</td>
<td width="106" valign="top"><p>5+ servings per day</td></tr><tr><td width="129" valign="top"><p>Desserts (cake, cookies, pies, doughnuts,etc.)</td><td width="94" valign="top"><p>',
  '#size' => 3,
'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_1'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  '#size' => 3,
'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_1'] = array(
'#type' => 'radio',
'#prefix' => '<td width="118" valign="top">',
  '#size' => 3,
'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_1'] = array(
'#type' => 'radio',
'#prefix' => '<td width="118" valign="top">',
  '#size' => 3,
'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_1'] = array(
'#type' => 'radio',
'#prefix' => '<td width="118" valign="top">',
  '#size' => 3,
'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_1'] = array(
'#type' => 'radio',
'#prefix' => '<td width="106" valign="top">',
  '#size' => 3,
'#maxlength' => 3,
'#suffix' => ' </td>
  </tr>',
);
//End Row 1
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Full-fat cheeses or milk</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_2'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr>',
);
//End Row 2
$form['q8_3'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Sausage or bacon</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_3'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_3'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_3'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_3'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_3'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr>',
);
//End row 3
$form['q8_4'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Fried Potatoes</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_4'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_4'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_4'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_4'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_4'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr>',
);
//End Row 4
$form['q8_5'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Candy</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_5'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_5'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_5'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_5'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_5'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr>',
);
//End row 5
$form['q8_6'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Sugared Sodas</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_6'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_6'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_6'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_6'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_6'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr>',
);
//End row 6
$form['q8_7'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Sports or energy drinks</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_7'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_7'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_7'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_7'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_7'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr>',
);
$form['q8_8'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Flavored milk or coffee beverages</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_8'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_8'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_8'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_8'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_8'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr>',
);
$form['q8_9'] = array(
'#type' => 'radio',
'#prefix' => '<tr><td width="129" valign="top">Sweetened ice tea</td><td width="94" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_9'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_9'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_9'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_9'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td>',
);
$form['q8_9'] = array(
'#type' => 'radio',
'#prefix' => '<td width="116" valign="top">',
  //'#size' => 3,
//'#maxlength' => 3,
'#suffix' => '</td></tr></table><p>&nbsp;</p>',
);

Comments