[SOLVED]Returning Multiple Selected in Select control (Forms
Posted: Wed Jun 27, 2007 8:41 pm
I have a option control that has multiple enabled:
This creates a select control that has an option for each item in an array.
When this form is submitted I check $_POST['lstfriends'] with the print_r function. The problem is that I have multiple entries selected and it only returns the last of those selected. Is there another method used to return all the entries selected?
Code: Select all
<SELECT name="lstfriends" multiple="yes" size=5>
<?php
$friendid = explode(',', $opt['friends']);
// parse friends
foreach ($friendid as $fid) {
echo '<option>' . $fid . '</option>';
}
?>
</SELECT>When this form is submitted I check $_POST['lstfriends'] with the print_r function. The problem is that I have multiple entries selected and it only returns the last of those selected. Is there another method used to return all the entries selected?