Using SELECT and MULTIPLE in a form
| From: | James Kaufman | Date: | Sun, 02 Feb 2003 03:29:30 +0000 |
| Subject: | Using SELECT and MULTIPLE in a form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-133951@lists.php.net to get a copy of this message | ||
I am displaying a form using values obtained from a database query.
One of the elements contains about 20 different values. I want the
use to be able to select multiple values before pressing submit.
This seems to work, but when my php script is called, all I see is
the last data value assigned to the variable. I could use a pointer.
Here is a code snippet:
echo "<TR>\n";
echo " <TD>Task Description</TD>\n";
echo " <TD><SELECT NAME='in_task_descr' MULTIPLE SIZE=4>\n";
for ($j = 0; $j < $tskcount; $j++) {
echo "<OPTION
VALUE=\"$taskdescr[$j]\">$taskdescr[$j]</OPTION>\n";
}
echo " </SELECT>\n";
echo " </TD>\n";
echo "</TR>\n\n";
The above code adds a list to the form and the user can highlight more than one
entry.
How do I access the data after the user presses submit?
--
Jim Kaufman mailto:jmk@linuxforbusiness.net
Linux Evangelist cell: 612-481-9778
public key 0x6D802619 fax: 952-937-9832
http://www.linuxforbusiness.net