NYCPHP Meetup

NYPHP.org

[nycphp-talk] Newbie question - multi-select list box

Jeff jsiegel1 at optonline.net
Fri May 2 09:00:05 EDT 2003


Daniel, 


Here's the code that generates the multi-select box. What I'm wondering
is how to get the 'selected' to show up when the user has posted (the
form posts to itself and I want to retain the values in the form). I'm
assuming I have to do something like looping through the array for
DL_mCategories since the user can select multiple items.

<td><select name="DL_mCategories[]" size="6" multiple
id="DL_mCategories">
 <?php
	do {  
	?>
	<option value="<?php echo $row_Search_Cats['DS_ID']?>"><?php
echo $row_Search_Cats['DS_sCatDescrip']?></option>
		<?php
			} while ($row_Search_Cats =
mysql_fetch_assoc($Search_Cats));
			$rows = mysql_num_rows($Search_Cats);
			if($rows > 0) {
			mysql_data_seek($Search_Cats, 0);
			$row_Search_Cats =
mysql_fetch_assoc($Search_Cats);
			}
		?>
	</select></td>



-----Original Message-----
From: Daniel Kushner [mailto:nyphp at websapp.com] 
Sent: Friday, May 02, 2003 7:42 AM
To: NYPHP Talk
Subject: RE: [nycphp-talk] Newbie question - multi-select list box


Jeff,

Can you send a snippet of the HTML. 

--Daniel

> -----Original Message-----
> From: Jeff [mailto:jsiegel1 at optonline.net]
> Sent: Friday, May 02, 2003 8:35 AM
> To: NYPHP Talk
> Subject: [nycphp-talk] Newbie question - multi-select list box
> 
> 
> I have a multi-select list on a form that posts to itself. However, 
> while other items, such as text boxes retain their values (I'm using 
> something like <?php echo $_POST['DL_sAddr2'] ?> ) I'm scratchin' my 
> head on how to do the same with the multi-select list.
> 
> TIA,
> 
> Jeff
> 
> 
> 
> 
> 
> 



--- Unsubscribe at http://nyphp.org/list/ ---






More information about the talk mailing list