Hi, just started to learn php so fairly new to the concepts.
Need some help making a sticky select form from an array.
This is what i have so far:
print '<label>Select your favourite colours:';
print '</label>';
print '<select name="colour" multiple="multiple">';
$colours= array('R'=>'Red','O'=>'Orange','Y'=>'Yellow','G'=>'Green','B'=>'Blue','P'=>'Purple','Pi'=>'Pink');
foreach($colours as $colour => $cname){
if($csel === $colour){
$sel = 'selected="selected"';
}
else{
$sel = '';
}
print '<option value="'.$colour.''.$sel.'>'.$cname.'</option>';
}
print '</select>';