Jump to content

While Loop Interfering with <OL>/<LI> Alignment Issue


xProteuSx

Recommended Posts

I hope I can make someone understand what the problem is ... its 1 am and I am crashing hard.  The whole problem is that this snippet really does not like the <ol type="a"> outside of the 'while' loop.  What I am trying to do is, say the array has 4 variables, I would like a., b., c., and d., to appear to the left of the <input type="radio" name="answer" value="' . $value . '"> button(s).  Now, I am getting something there, but I am getting 0., 0., 0., and 0. instead of the letters.

 

Please help!!!!  Thanks in advance.

 

echo '<center>';
echo '<form action="mark_spec.php">';
echo '<ol type="a">';

while (list($key,$value) = each($answers_array))
{
echo '<table width="400" cellspacing="0" cellpadding="2">';
echo '<tr>';
echo '<td valign="top">';
echo '<li>';
echo '<font size="-1"> <input type="radio" name="answer" value="' . $value . '"></font>';
echo '</td>';
echo '<td valign="top">';
echo '<font size="-1">' . $value . '</font>';
echo '</li>';
echo '</td>';
echo '</tr>';
echo '</table>';
}

echo '</ol>';
echo '<input type="submit" value="Check Answer">';
echo '</form>';
echo '</center>';

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.