...

View Full Version : Radio boxes to display data



graham23s
08-12-2007, 08:53 PM
Hi Guys,

i now know how to display the relevant data a user has selected using drop down boxes and arrays like:


<td align="right"><b>Format</b></td><td align="center"><select name="format">';
#########################################################################
foreach ($format_arrays as $value) {
echo "<option Value=\"{$value}\"";
if ($value == $format) { echo 'SELECTED'; }
echo ">{$value}</option>";
}
#########################################################################
echo ' </select>

but im not sure how to do the same with radio buttons

any help would be appreciated

cheers

Graham

Inigoesdr
08-12-2007, 09:51 PM
Something like this:


foreach ($format_arrays as $value)
{
echo '<input type="radio" value="' . $value . '"' . ($value == $format ? ' checked="checked"' : '') . '" />' . $value;
}
Not tested.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum