[FX.php List] Checkbox

Rob H. Christensen robhelleshoj at tiscali.dk
Sun Apr 2 08:38:25 MDT 2006


I have some checkboxes, which can have multiple values. How do I show the
checked boxes on the page?

I have tried this:
<?PHP
$TRK=$Data['Trykkeri'][0];
foreach($Vis2ListResult['valueLists']['Trykkeri'] as $key=>$value){
            if($TRK==$value){ $Select="checked";}else{$Select="";} ?>
            <input type="checkbox" name="Trykkeri" value="<?PHP echo $value;
?>""<?PHP echo $Select;?>"><?PHP echo $value;
            }?>

This shows the checked box as long as there is only one checked. As soon as
more options are checked, it only shows empty checkboxes.

$TRK is an array, which correctly displays the checked boxes.

Any suggestions?

Rob




More information about the FX.php_List mailing list