Re: [PHP] Using SELECT and MULTIPLE in a form
Hi, Sunday, February 2, 2003, 1:29:30 PM, you wrote: JK> I am displaying a form using values obtained from a database query. JK> One of the elements contains about 20 different values. I want the JK> use to be able to select multiple values before pressing submit. JK> This seems to work, but when my php script is called, all I see is JK> the last data value assigned to the variable. I could use a pointer. JK> Here is a code snippet: JK> echo "\n"; JK> echo " Task Description\n"; JK> echo " \n"; JK> for ($j = 0; $j < $tskcount; $j++) { JK> echo "$taskdescr[$j]\n"; JK> } JK> echo " \n"; JK> echo " \n"; JK> echo "\n\n"; JK> The above code adds a list to the form and the user can highlight more than one JK> entry. JK> How do I access the data after the user presses submit? JK> -- JK> Jim Kaufman mailto:[EMAIL PROTECTED] JK> Linux Evangelistcell: 612-481-9778 JK> public key 0x6D802619 fax: 952-937-9832 JK> http://www.linuxforbusiness.net This popped up using google http://www.onlinetools.org/tricks/using_multiple_select.php -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using SELECT and MULTIPLE in a form
Put empty square brackets (NAME='in_task_descr[]') after the name of your select element. Then all the slections will be in an array called... $_POST['in_task_descr'] or $_GET['in_task_descr'] Depending on your form method. James Kaufman wrote: 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 "\n"; echo " Task Description\n"; echo " \n"; for ($j = 0; $j < $tskcount; $j++) { echo "$taskdescr[$j]\n"; } echo " \n"; echo " \n"; echo "\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? -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using SELECT and MULTIPLE in a form
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 "\n"; echo " Task Description\n"; echo " \n"; for ($j = 0; $j < $tskcount; $j++) { echo "$taskdescr[$j]\n"; } echo " \n"; echo " \n"; echo "\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:[EMAIL PROTECTED] Linux Evangelistcell: 612-481-9778 public key 0x6D802619 fax: 952-937-9832 http://www.linuxforbusiness.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php