Whoops!  Still won't work but that code should read:

                echo "<form>";
        echo "<select name=\"display\">";
        echo "<option value=\"true\"";
        if ($display==true){echo "selected";}
        echo ">Display";
        echo "<option value=\"false\"";
        if ($display==false){echo "selected";}
        echo "selected>Don't Display";
        echo "</select>";
        echo "</form>";

>>> ROBERT MCPEAK 03/20/02 04:20PM >>>
I'd like to determine the selected option in a select list based on a
passed variable.  The code below won't work, but I can't figure out why.
 Any guesses?


                echo "<form>";
        echo "<select name=\"display\">";
        echo "<option value=\"true\"";
        if ($display==false){echo "selected";}
        echo ">Display";
        echo "<option value=\"false\"";
        if ($display==false){echo "selected";}
        echo "selected>Don't Display";
        echo "</select>";
        echo "</form>";


Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to