Re: Help with multiple select

From: Date: Fri, 09 Aug 2002 15:56:12 +0000
Subject: Re: Help with multiple select
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-111832@lists.php.net to get a copy of this message
Untested... $row = mysql_fetch_array($result, MYSQL_ASSOC); # Assuming items are comma separated in the field... $mins = explode(',', $row['mins']); echo "<form><table><tr><td>\n"; echo " <select name=\"mins[]\" size=\"12\" multiple>\n"; for ($i=0; $i<12; $i++) { echo " <option value\"$i\""; if ( in_array($i, $mins) ) { echo ' selected'; } echo ">$i</option>\n" } echo " </select>\n\n"; echo "</td><td>\n"; echo " <select name=\"mins[]\" size=\"12\" multiple>\n"; for (; $i<24; $i++) { echo " <option value\"$i\""; if ( in_array($i, $mins) ) { echo ' selected'; } echo ">$i</option>\n" } echo " </select>\n\n"; echo "</td></tr></table></form>"; --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

« previous php.general (#111832) next »