> > 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
Check if the variable has been posted and echo the value like below on the
first option line is how I do it. This will put two options with the same
value in the select box and the first will be selected.
<? if(isset($HTTP_POST_VARS["variable"])) echo '<option
value="'.$HTTP_POST_VARS["variable"].'"
selected>'.$HTTP_POST_VARS["variable"].'</option>'; ?>
or add to each option: if ($HTTP_POST_VARS["variable"] == 'option
value')echo 'selected';
example:
<option value="value" <?if ($HTTP_POST_VARS["variable"] == 'option
value')echo 'selected'; ?>>some text</option>
HTH,
Brett
--
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]