"sticky" multiple select menus in PHP

by David Mintz <mambomintz(at)yahoo.com>

 Date:  Tue, 19 Dec 2000 19:31:22 -0800 (PST)
 To:  hwg-languages(at)hwg.org
  todo: View Thread, Original
Is this really just about the only way to do this? It
seems like a lot of work.

<select multiple name="beers[]">
<? $options = array("Harp's","Bass","Guinness",
		"Sierra Nevada");

for ($i=0;$i<count($options);$i++) {
	print "<option" ; 
	for ($j=0;$j<count($beers);$j++) { 
		if ($beers[$j] == $options[$i]) { 
			print  " selected"; 
		}
	}
	print ">$options[$i]</option>";
}
?>
</select>

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA