Thanks to Gerald, Werner, Gerlinde and Josh for help with the SELECT
form element. Gerald's was the simplest, most pragmatic solution,
but I ended up figuring out something that was a bit more like
Gerlinde and Josh suggested, but saving on a real 'if-then-else' loop
and doing it all in one
I have a Contact information page that draws from or writes to a
table [contact] and displays that information in an HTML form. There
is a field [type] that I want to have populated from a pulldown list,
and that pulldown list is drawn from another table [contact_type].
I'm using PHP 3.x for
Print the current value as the first entry of the pulldown.
It will be in the pulldown twice, but so what?
Nelson Goforth wrote:
I have a Contact information page that draws from or writes to a table
[contact] and displays that information in an HTML form. There is a
field [type] that I
If I understand you correctly, here is my approach in php:
You look at the selected value first and store it in idSelected;
then you insert a condition and evaluate that condition in your
printf statement:
while ($row = mysql_fetch_object ($list)) {
$selected = $row-id ==
02, 2001 3:11 PM
To: Nelson Goforth
Cc: [EMAIL PROTECTED]
Subject: Re: SELECT form element with PHP/MySQL
Print the current value as the first entry of the pulldown.
It will be in the pulldown twice, but so what?
Nelson Goforth wrote:
I have a Contact information page that draws from or writes