<select name="circulation[]" size="4" multiple="multiple" id="circulation">
<?php
for ($i= 0; $i < $arrayLength; $i++){
if(isset($circulation[$i]) && $circulation[$i] === $staff[$i])
{
echo "<option value=\"".$staff[$i]. "\" selected>".$staff[$i]."</option>\n";
}
else
{
echo "<option value=\"".$staff[$i]. "\">".$staff[$i]."</option>\n";
}}
?>
</select>
I am using this to populate my select box. As you can see I have a condition in there for error handling. When the form is parsed if it throws and error I just include the form again with all the variables....
Why would the code only put the select attribute on the 1st part of the $circulation array? What I mean is that it will only show selected the first entry of the populated array.
Jamie