This topic is locked

Radio Buttons displayed horizontally

9/12/2006 3:25:45 PM
PHPRunner General questions
D
drh author

Hello forum members,
I know I read about this on the forum before, but can't seem to find it anywhere now.
I have a field of type radio button. With the default build, the radio buttons are aligned vertically on multiple lines.
Is there a way to display the buttons on one line...horizontally.
thanks.
Dave

J
Jane 9/13/2006

Dave,
open include/..._functions.php file, find BuildRadioControl function and remove all
tags in the following lines:

if($LookupSQL)

{

LogInfo($LookupSQL);

$rs=db_query($LookupSQL,$conn);

if(!db_numrows($rs))

return "";

$ret='<input type=hidden name="value'.$ifield.'" value="'.htmlspecialchars($value).'">';

while($data=db_fetch_numarray($rs))

{

if($data[0]==$value)

$ret.='<input type="Radio" name="radio'.$ifield.'" onclick="java script: value'.$ifield.".value='".db_addslashes($data[0]).'\'; return true;" checked>'.htmlspecialchars($data[1])."
"
;

else

$ret.='<input type="Radio" name="radio'.$ifield.'" onclick="java script: value'.$ifield.".value='".db_addslashes($data[0]).'\'; return true;">'.htmlspecialchars($data[1])."
"
;

}

}

else

{

$ret='<input type=hidden name="value'.$ifield.'" value="'.htmlspecialchars($value).'">';

foreach($arr as $opt)

{

if($opt==$value)

$ret.='<input type="Radio" name="radio'.$ifield.'" onclick="java script: value'.$ifield.".value='".db_addslashes($opt).'\'; return true;" checked>'.htmlspecialchars($opt)."
"
;

else

$ret.='<input type="Radio" name="radio'.$ifield.'" onclick="java script: value'.$ifield.".value='".db_addslashes($opt).'\'; return true;">'.htmlspecialchars($opt)."
"
;

}

}