Posted by rich on 12/08/99 11:49
I have a database with 1 to many and the many is a list with multiple
selects in a list. When I click on a master record I have as part of
my form the select statement for the multiple choice list. I want the
list to highlight the multiple chosen values. here is part of the
code.
$dresscat = specdresscat($dresstypeid); //this is the query to get the
values in the detail table
$drcatrow = pg_fetch_array($dresscat);// the array for the detail
table.
<select name="stages[]" multiple="multiple">
<?php
$allstages = allstages(); // this is a function to query my database
to get the value for the list.
while ($allstagerows=pg_fetch_array($allstages)) {
$eachstage= $allstagerows["stageid"];
$specstage= $drcatrow["stageid"]; // this is the point I need help
if ($specstage == $eachstage){ ?>
<option value=<?php echo $eachstage;?> selected="selected"><?php echo
allstagerows["stage"]?></option>
<?php }else{ ?>
<option value=<?php echo $eachstage;?>><?php echo
$allstagerows["stage"]?></option>
<?php
}
}
?>
</select>
This is the select statement I have now. I get the first falue to be
chosen but not the other values.
[Back to original message]
|