Re: Question: Repopulating form parameters

From: Date: Sun, 12 Dec 2004 10:15:38 +0000
Subject: Re: Question: Repopulating form parameters
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-204091@lists.php.net to get a copy of this message
--- Jason Wong <php-general@gremlins.biz> wrote: > > I'm pretty sure I need to loop through the $_Get > of > > the array. Not sure , and haven't found anything > > that shows this. > > Yes, you need to reference $_GET to see whether an > option was selected and > change the echo above accordingly. > Still stuck on this one. I know I'm doing something wrong and wouldn't mind some correction: Code now: if (count($Ind) > 0 AND is_array($Ind)) { $Ind = "'".implode("','", $Ind)."'"; <select name="Ind[]" size="8" multiple="multiple" id="Ind[]" > <?php $selected = $_GET['Ind']; while($row = mysql_fetch_array($inds, MYSQL_BOTH)) { if ($selected==$row['CareerIDs']) echo ' selected'; echo '<option value="'.$row['CareerIDs'].'">'.$row['CareerCategories'].'</option>'; } ?> Stuart

« previous php.general (#204091) next »