Hi all,
I am working on a form which has 2 lists.
List 1 is dynamic and pulls its content from a data table.
List 2 contains selected items from list 1.
The user can select multiple items from list 1 and on selecting one or more items I have some JavaScript that populate list 2.
I then want to POST the content of list 2 in to another table. My problem is that I am only post one selected item and not multipul items. From waht I have read I need to create an arry to hold my POSTing data.
My form:
<form method="post" name="combo_box" action="<?php echo $editFormAction; ?>">
<input name="member_id" type="hidden" value="<?php $_SESSION'member_id']; ?>" />
<table cellpadding="4" cellspacing="0" border="0">
<tr>
<td>
<select multiple size="10" name="list1" style="width:150" onDblClick="move(document.combo_box.list1,document.combo_box.list2)">
<?php
do {
?>
<option value="<?php echo $row_packinglista['id']?>"><?php echo $row_packinglista['description']?></option>
<?php
} while ($row_packinglista = mysql_fetch_assoc($packinglista));
$rows = mysql_num_rows($packinglista);
if($rows > 0) {
mysql_data_seek($packinglista, 0);
$row_packinglista = mysql_fetch_assoc($packinglista);
}
?>
</select>
</td>
<td align="center" valign="middle">
<input type="button" onClick="move(this.form.list2,this.form.list1)" value="<<" id=button1 name=button1>
<input type="button" onClick="move(this.form.list1,this.form.list2)" value=">>" id=button2 name=button2>
</td>
<td>
<select multiple size="10" name="list2" style="width:150" onDblClick="move(document.combo_box.list2,document.combo_box.list1)">
</select>
</td>
</tr>
<tr><td align="center" colspan="3"><input type="submit" name="submit_button" value="Submit" onClick="selectAll(document.combo_box.list2);"></td></tr>
</table>
<input type="hidden" name="MM_insert" value="combo_box" />
</form>
How can I create an arry to hold the POSTed data.