hi dave,


i usually do this from entries in a database

but it should also work this way with an array




// first make an array holding all the cities
$myTowns = array("London","New York","HongKong","Johannesburg");
$ArrayElements = 4;


this is now creating the dropdown-box:

<select name="town">
<?
for ($i=0;$i<$ArrayElements;$i++) {
     $selma="";
     $tacco = $myTowns[$i];
     if ($tacco == $town) { $selma = "selected";}
     $item="<option value=\"$tacco\" ".$selma.">".$tacco."</option>";
     echo $item;
}
?>
</select>



greetinx

andre
viva technologies


----- Original Message -----
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 03, 2001 8:29 AM
Subject: [PHP-DB] How do I keep the selected showing...


> Hi All
> I have a fully functional db site which uses 2 sqls and 1 page to give our
> visitors info they need.
>
> That works fine, but some users have remarked that it would be nice that
the
> selected item from our drop down list stays shown when the page gives the
> info instead of going back to the top of the list.
>
> http://www.angelettes.co.uk/dates/index.php3 is the url in action and
> choosing different towns will show you what I mean.
>
> Its not the end of the world, as our visitors have said, but would be
nice.
>
> Any help is full appreciated.
>
> Dave C
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to