473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Multiple select list in PHP

Hi all

I have more than one multiple select lists in a page. Something like this

<tr>

<td>
<select NAME="StrainList" ID="StrainList" SIZE="5" multiple="multiple" style="width: 150px">
<?
for ($i=0; $i < $rows; $i++)
{
mysql_data_seek($result,$i);
$qryrslt = mysql_fetch_array($result);
echo "<option value='$qryrslt[0]'>$qryrslt[0]</option>";
}

?>
</select></td>
<td>
<input TYPE="BUTTON" VALUE="->" ONCLICK="addIt('StrainList', 'PickList');"></input>
<br>
<input TYPE="BUTTON" VALUE="<-" ONCLICK="delIt('StraintList', 'PickList');"></input></td>
<td>
<select NAME="PickList[]" ID="PickList" SIZE="5" multiple="multiple" style="width: 150px">
</select></td>
</tr>

<tr>
<td ALIGN="left">&nbsp;</td>
<td></td>
<td ALIGN="right">&nbsp;</td>
</tr>
<tr>
<td colspan="3" ALIGN="left"><div align="center"><font size="-1" face="Arial, Helvetica, sans-serif">Hydrolysis of chromogenic substrates </font> </div></td>
</tr>
<tr>
<td>
<select NAME="SelectListn" ID="SelectListn" SIZE="5" multiple="multiple" style="width: 150px">
<?
for ($i=0; $i < $rows3; $i++)
{
mysql_data_seek($result3,$i);
$qryrslt = mysql_fetch_array($result3);
echo "<option value='$qryrslt[0]'>$qryrslt[0]</option>";
}

?>
</select></td>
<td>
<input TYPE="BUTTON" VALUE="->" ONCLICK="addIt('SelectListn', 'PickListn');"></input>
<br>
<input TYPE="BUTTON" VALUE="<-" ONCLICK="delIt('SelectListn', 'PickListn');"></input></td>
<td>
<select NAME="PickListn[]" ID="PickListn" SIZE="5" multiple="multiple" style="width: 150px">
</select></td>
</tr>
<tr>

when i am trying to porcess my form in php, only the first picklis tis getting detected. The second one is not. Any help would be greatly appreciated
Jul 18 '06 #1
1 5859
hsriat
1,654 Expert 1GB
If your select list is multiple, suffix square brackets to the name. That will submit an array of all the selected values to your target script.
[HTML]<select NAME="StrainList[]" ID="StrainList" SIZE="5" multiple="multiple" style="width: 150px">[/HTML]
May 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: rich | last post by:
I have a database with 1 to many and the many is a list with multiple selects in a list. When I click on a master record I have as part of my form the select statement for the multiple choice...
3
by: imrantbd | last post by:
This is my first problem.Please help me. I have the following code: <head> <script language="JavaScript"> function addSrcToDestList() { destList1 = window.document.forms.destList; srcList...
3
by: imrantbd | last post by:
I need array type name like "destList" must use for my destlist select box,not a single name.Or need a solution to capture multiple value of "destList" select box and send all selected value in php...
1
by: Jeff Gardner | last post by:
Greetings: I have a table with 3 pieces of data that I would like to use to dynamically populate 3 drop downs using javascript. The fields are state, orgname, office. If it's not already...
3
by: swethasivaram | last post by:
Hello I have a multiple select list as follows: <select name="selList" multiple> <option value="1"Item 1</option> <option value="2"Item 2</option> <option value="3"Item 3</option> </select>
4
by: rn5a | last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5 options are shown at any given time) allows multiple selection whereas the 2nd one allows only 1 option to be selected at a time. ...
2
by: billa856 | last post by:
Hi, My Project is in MS Access. In that I have one form in which I have some textboxes,comboboxes and listboxes. Now when I select value from 1st combobox(CustomerID) then it wil generate list for...
2
by: permander kumar | last post by:
hi plz help me, i have a code in which two multiple selection dropdown list. in first list if I am select single value the data are fetch in second table on button click. but the problem is in...
1
by: KrazyKasper | last post by:
Access 2003 – Multi-Column List Box – Select Multiple Items I have a multi-column (3 columns) list box that works well to select one set of records or all sets of records (based on the first field...
6
by: woodey2002 | last post by:
Hi Everyone. Thanks for your time. I am trying to create a search form that will allow users to select criteria from multiple multi select boxes. So far i have managed to achieve a search option...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.