ewwwww How about: ?> <select name="status"> <option value="On-Line"<? if ($edit['status'] == 'On-Line') { echo ' selected="selected"'; } ?>>On-Line</option> <option value="Off-Line"<? if ($edit['status'] == 'Off-Line') { echo ' selected="selected"'; } ?>>Off-Line</option> </select> <?
There's much better/general ways to do it, but the above is a nice, clean, quick and dirty way of doing it. Yes, clean and dirty. ;) Mike Dan McCullough wrote: >Here is what I did. >if ($edit[status]=="On-line") { >print "Status: <select name=\"status\">\n"; >print "<option value=\"On-line\" selected>On-line\n"; >print "<option value=\"Off-line\">Off-line\n"; >print "</select><br>\n"; >} else { >print "Status: <select name=\"status\">\n"; >print "<option value=\"On-line\">On-line\n"; >print "<option value=\"Off-line\" selected>Off-line\n"; >print "</select><br>\n"; >} >//and >if ($edit[single]=="1") { >print "Single: Yes <input type=\"radio\" name=\"single\" value=\"1\" checked> or No ><input >type=\"radio\" name=\"single\" value=\"0\"><br><br>\n"; >} else { >print "Single: Yes <input type=\"radio\" name=\"single\" value=\"1\"> or No <input >type=\"radio\" >name=\"single\" value=\"0\" checked><br><br>\n"; >} > >that works >--- faeton <[EMAIL PROTECTED]> wrote: > >>Hello Dan, >> >>Thursday, November 29, 2001, 7:11:22 PM, you've written: >>DM> I need to edit a entry into the database via an admin script, how do I work in a >radio >>selection >>DM> box, and populate it with the correct selection? >> >>Something like that, maybe :) >> >><input type="radio" name="var" value="1"> >><input type="radio" name="var" value="2"> >><input type="radio" name="var" value="3"> >> >> >> >>------------------------------------------------ >>Ivan 'Faeton aka xetrix' Danishevsky >>ICQ(240266) [EMAIL PROTECTED] www.xemichat.com >> >> >>-- >>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] >> > > >===== >Dan McCullough >------------------------------------------------------------------- >"Theres no such thing as a problem unless the servers are on fire!" >h: 603.444.9808 >w: McCullough Family >w: At Work > >__________________________________________________ >Do You Yahoo!? >Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. >http://geocities.yahoo.com/ps/info1 >